Commit 8275c468 authored by Nicolas Carion's avatar Nicolas Carion

Refactor Transition -> Composition

parent 44243d79
set(kdenlive_SRCS
${kdenlive_SRCS}
timeline2/model/clipmodel.cpp
timeline2/model/compositionmodel.cpp
timeline2/model/groupsmodel.cpp
timeline2/model/timelineitemmodel.cpp
timeline2/model/timelinetransitionmodel.cpp
timeline2/model/timelinemodel.cpp
timeline2/model/trackmodel.cpp
timeline2/model/transitionmodel.cpp
timeline2/model/snapmodel.cpp
timeline2/model/undohelper.cpp
timeline2/model/builders/meltBuilder.cpp
......
......@@ -90,20 +90,20 @@ bool constructTimelineFromMelt(std::shared_ptr<TimelineItemModel> timeline, Mlt:
}
}
// Loading transitions
// Loading compositions
QScopedPointer<Mlt::Service> service(tractor.producer());
while (service && service->is_valid()) {
if (service->type() == transition_type) {
Mlt::Transition t((mlt_transition) service->get_service());
int tid;
std::shared_ptr<Mlt::Transition> transition(new Mlt::Transition(t));
std::shared_ptr<Mlt::Transition> composition(new Mlt::Transition(t));
qDebug()<<"////////// BUILD TRANS ON TK: "<<t.get_b_track();
ok = timeline->requestTransitionInsertion(transition, t.get_b_track(), tid, undo, redo);
ok = timeline->requestCompositionInsertion(composition, t.get_b_track(), tid, undo, redo);
if (!ok) {
qDebug() << "ERROR : failed to insert transition in track "<<transition->get_b_track()<<", position"<<transition->get_in();
qDebug() << "ERROR : failed to insert composition in track "<<composition->get_b_track()<<", position"<<composition->get_in();
break;
} else {
qDebug() << "Inserted transition in track "<<transition->get_b_track()<<", position"<<transition->get_in();
qDebug() << "Inserted composition in track "<<composition->get_b_track()<<", position"<<composition->get_in();
}
}
service.reset(service->producer());
......
......@@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "transitionmodel.hpp"
#include "compositionmodel.hpp"
#include "timelinemodel.hpp"
#include "trackmodel.hpp"
#include "undohelper.hpp"
......@@ -26,23 +26,23 @@
#include <QDebug>
TransitionModel::TransitionModel(std::weak_ptr<TimelineModel> parent, std::weak_ptr<Mlt::Transition> trans, int id) :
CompositionModel::CompositionModel(std::weak_ptr<TimelineModel> parent, std::weak_ptr<Mlt::Transition> trans, int id) :
m_parent(parent)
, m_id(id == -1 ? TimelineModel::getNextId() : id)
, m_position(-1)
, m_currentTrackId(-1)
, m_transition(trans)
, m_composition(trans)
{
}
int TransitionModel::construct(std::weak_ptr<TimelineModel> parent, std::shared_ptr<Mlt::Transition> trans, int id)
int CompositionModel::construct(std::weak_ptr<TimelineModel> parent, std::shared_ptr<Mlt::Transition> trans, int id)
{
std::shared_ptr<TransitionModel> transition(new TransitionModel(parent, trans, id));
id = transition->m_id;
std::shared_ptr<CompositionModel> composition(new CompositionModel(parent, trans, id));
id = composition->m_id;
if (auto ptr = parent.lock()) {
ptr->registerTransition(transition);
ptr->registerComposition(composition);
} else {
qDebug() << "Error : construction of transition failed because parent timeline is not available anymore";
qDebug() << "Error : construction of composition failed because parent timeline is not available anymore";
Q_ASSERT(false);
}
......@@ -50,62 +50,62 @@ int TransitionModel::construct(std::weak_ptr<TimelineModel> parent, std::shared_
}
int TransitionModel::getId() const
int CompositionModel::getId() const
{
return m_id;
}
int TransitionModel::getCurrentTrackId() const
int CompositionModel::getCurrentTrackId() const
{
return m_currentTrackId;
}
int TransitionModel::getPosition() const
int CompositionModel::getPosition() const
{
return m_position;
}
int TransitionModel::getPlaytime() const
int CompositionModel::getPlaytime() const
{
return m_transition->get_length();
return m_composition->get_length();
}
const QString TransitionModel::getProperty(const QString &name) const
const QString CompositionModel::getProperty(const QString &name) const
{
return QString::fromUtf8(m_transition->get(name.toUtf8().constData()));
return QString::fromUtf8(m_composition->get(name.toUtf8().constData()));
}
std::pair<int, int> TransitionModel::getInOut() const
std::pair<int, int> CompositionModel::getInOut() const
{
return {m_transition->get_in(), m_transition->get_out()};
return {m_composition->get_in(), m_composition->get_out()};
}
int TransitionModel::getIn() const
int CompositionModel::getIn() const
{
return m_transition->get_in();
return m_composition->get_in();
}
int TransitionModel::getOut() const
int CompositionModel::getOut() const
{
return m_transition->get_out();
return m_composition->get_out();
}
bool TransitionModel::isValid()
bool CompositionModel::isValid()
{
return m_transition->is_valid();
return m_composition->is_valid();
}
bool TransitionModel::requestResize(int size, bool right, Fun& undo, Fun& redo)
bool CompositionModel::requestResize(int size, bool right, Fun& undo, Fun& redo)
{
if (size <= 0 || size > m_transition->get_length()) {
if (size <= 0 || size > m_composition->get_length()) {
return false;
}
int delta = m_transition->get_length() - size;
int in = m_transition->get_in();
int out = m_transition->get_out();
int delta = m_composition->get_length() - size;
int in = m_composition->get_in();
int out = m_composition->get_out();
int old_in = in, old_out = out;
//check if there is enough space on the chosen side
if ((!right && in + delta < 0) || (right && out - delta >= m_transition->get_length())) {
if ((!right && in + delta < 0) || (right && out - delta >= m_composition->get_length())) {
return false;
}
if (right) {
......@@ -118,7 +118,7 @@ bool TransitionModel::requestResize(int size, bool right, Fun& undo, Fun& redo)
std::function<bool (void)> track_reverse = [](){return true;};
/*if (m_currentTrackId != -1) {
if (auto ptr = m_parent.lock()) {
track_operation = ptr->requestTransitionResize_lambda(m_id, in, out, right);
track_operation = ptr->requestCompositionResize_lambda(m_id, in, out, right);
} else {
qDebug() << "Error : Moving clip failed because parent timeline is not available anymore";
Q_ASSERT(false);
......@@ -126,7 +126,7 @@ bool TransitionModel::requestResize(int size, bool right, Fun& undo, Fun& redo)
}
auto operation = [this, in, out, track_operation]() {
if (track_operation()) {
m_transition->set_in_and_out(in, out);
m_composition->set_in_and_out(in, out);
return true;
}
return false;
......@@ -135,11 +135,11 @@ bool TransitionModel::requestResize(int size, bool right, Fun& undo, Fun& redo)
// Now, we are in the state in which the timeline should be when we try to revert current action. So we can build the reverse action from here
auto ptr = m_parent.lock();
if (m_currentTrackId != -1 && ptr) {
track_reverse = ptr->requestTransitionResize_lambda(m_id, old_in, old_out, right);
track_reverse = ptr->requestCompositionResize_lambda(m_id, old_in, old_out, right);
}
auto reverse = [this, old_in, old_out, track_reverse]() {
if (track_reverse()) {
m_transition->set_in_and_out(old_in, old_out);
m_composition->set_in_and_out(old_in, old_out);
return true;
}
return false;
......@@ -150,21 +150,21 @@ bool TransitionModel::requestResize(int size, bool right, Fun& undo, Fun& redo)
return false;
}
void TransitionModel::setPosition(int pos)
void CompositionModel::setPosition(int pos)
{
m_position = pos;
int length = m_transition->get_length();
m_transition->set_in_and_out(pos, pos + length);
int length = m_composition->get_length();
m_composition->set_in_and_out(pos, pos + length);
}
void TransitionModel::setInOut(int in, int out)
void CompositionModel::setInOut(int in, int out)
{
m_position = in;
m_transition->set_in_and_out(in, out);
m_composition->set_in_and_out(in, out);
}
void TransitionModel::setCurrentTrackId(int tid)
void CompositionModel::setCurrentTrackId(int tid)
{
m_currentTrackId = tid;
//m_transition->set_tracks(m_transition->get_a_track(), tid);
//m_composition->set_tracks(m_composition->get_a_track(), tid);
}
......@@ -19,8 +19,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef TRANSITIONMODEL_H
#define TRANSITIONMODEL_H
#ifndef COMPOSITIONMODEL_H
#define COMPOSITIONMODEL_H
#include <memory>
#include <QObject>
......@@ -32,16 +32,16 @@ namespace Mlt{
class TimelineModel;
class TrackModel;
/* @brief This class represents a Transition object, as viewed by the backend.
/* @brief This class represents a Composition object, as viewed by the backend.
In general, the Gui associated with it will send modification queries (such as resize or move), and this class authorize them or not depending on the validity of the modifications
*/
class TransitionModel
class CompositionModel
{
TransitionModel() = delete;
CompositionModel() = delete;
protected:
/* This constructor is not meant to be called, call the static construct instead */
TransitionModel(std::weak_ptr<TimelineModel> parent, std::weak_ptr<Mlt::Transition> prod, int id = -1);
CompositionModel(std::weak_ptr<TimelineModel> parent, std::weak_ptr<Mlt::Transition> prod, int id = -1);
public:
......@@ -83,7 +83,7 @@ public:
friend class TimelineModel;
/* Implicit conversion operator to access the underlying producer
*/
operator Mlt::Transition&(){ return *m_transition;}
operator Mlt::Transition&(){ return *m_composition;}
/* Returns true if the underlying producer is valid
*/
......@@ -119,10 +119,10 @@ protected:
void setCurrentTrackId(int tid);
private:
std::weak_ptr<TimelineModel> m_parent;
int m_id; //this is the creation id of the clip, used for book-keeping
int m_id; //this is the creation id of the composition, used for book-keeping
int m_position;
int m_currentTrackId;
std::shared_ptr<Mlt::Transition> m_transition;
std::shared_ptr<Mlt::Transition> m_composition;
};
......
......@@ -24,7 +24,7 @@
#include "trackmodel.hpp"
#include "clipmodel.hpp"
#include "transitionmodel.hpp"
#include "compositionmodel.hpp"
#include "groupsmodel.hpp"
#include "doc/docundostack.hpp"
#include <mlt++/MltTractor.h>
......@@ -78,11 +78,11 @@ QModelIndex TimelineItemModel::index(int row, int column, const QModelIndex &par
if (parent.isValid()) {
int trackId = int(parent.internalId());
Q_ASSERT(isTrack(trackId));
int transId = getTrackById_const(trackId)->getTransitionByRow(row);
int transId = getTrackById_const(trackId)->getCompositionByRow(row);
if (transId != -1) {
result = createIndex(row, 1, quintptr(transId));
} else {
//qDebug()<<"* * *CANNOT FIND TRANSITION IX : "<<transId;
//qDebug()<<"* * *CANNOT FIND COMPOSITION IX : "<<transId;
}
return result;
}
......@@ -94,7 +94,7 @@ QModelIndex TimelineItemModel::index(int row, int column, const QModelIndex &par
if (clipId != -1) {
result = createIndex(row, 0, quintptr(clipId));
} else {
int transId = getTrackById_const(trackId)->getTransitionByRow(row);
int transId = getTrackById_const(trackId)->getCompositionByRow(row);
if (transId != -1) {
result = createIndex(row, 1, quintptr(transId));
}
......@@ -120,11 +120,11 @@ QModelIndex TimelineItemModel::makeClipIndexFromID(int cid) const
return index(getTrackById_const(tid)->getRowfromClip(cid), 0, makeTrackIndexFromID(tid) );
}
QModelIndex TimelineItemModel::makeTransitionIndexFromID(int tid) const
QModelIndex TimelineItemModel::makeCompositionIndexFromID(int tid) const
{
Q_ASSERT(m_allTransitions.count(tid) > 0);
int trid = m_allTransitions.at(tid)->getCurrentTrackId();
return index(getTrackById_const(trid)->getRowfromTransition(tid), 0, makeTrackIndexFromID(trid, true) );
Q_ASSERT(m_allCompositions.count(tid) > 0);
int trid = m_allCompositions.at(tid)->getCurrentTrackId();
return index(getTrackById_const(trid)->getRowfromComposition(tid), 0, makeTrackIndexFromID(trid, true) );
}
QModelIndex TimelineItemModel::makeTrackIndexFromID(int tid, bool transition) const
......@@ -152,8 +152,8 @@ QModelIndex TimelineItemModel::parent(const QModelIndex &index) const
} else if(isClip(id)) {
const int trackId = getClipTrackId(id);
return makeTrackIndexFromID(trackId);
} else if(isTransition(id)) {
const int trackId = getTransitionTrackId(id);
} else if(isComposition(id)) {
const int trackId = getCompositionTrackId(id);
return makeTrackIndexFromID(trackId, true);
}
return QModelIndex();
......@@ -165,14 +165,14 @@ int TimelineItemModel::rowCount(const QModelIndex &parent) const
READ_LOCK();
if (parent.isValid()) {
const int id = (int)parent.internalId();
if (isClip(id) || isTransition(id) || !isTrack(id)) {
if (isClip(id) || isComposition(id) || !isTrack(id)) {
//clips don't have children
//if it is not a track and not a clip, it is something invalid
return 0;
}
// return number of clip in a specific track
//return parent.column() == 0 ? getTrackClipsCount(id) : getTrackTransitionsCount(id);
return getTrackClipsCount(id) + getTrackTransitionsCount(id);
//return parent.column() == 0 ? getTrackClipsCount(id) : getTrackCompositionsCount(id);
return getTrackClipsCount(id) + getTrackCompositionsCount(id);
}
return getTracksCount();
}
......@@ -206,7 +206,7 @@ QHash<int, QByteArray> TimelineItemModel::roleNames() const
roles[IsLockedRole] = "locked";
roles[FadeInRole] = "fadeIn";
roles[FadeOutRole] = "fadeOut";
roles[IsTransitionRole] = "isTransition";
roles[IsCompositionRole] = "isComposition";
roles[FileHashRole] = "hash";
roles[SpeedRole] = "speed";
roles[HeightRole] = "trackHeight";
......@@ -277,7 +277,7 @@ QVariant TimelineItemModel::data(const QModelIndex &index, int role) const
return clip->getIn();
case OutPointRole:
return clip->getOut();
case IsTransitionRole:
case IsCompositionRole:
return false;
default:
break;
......@@ -313,21 +313,21 @@ QVariant TimelineItemModel::data(const QModelIndex &index, int role) const
default:
break;
}
} else if(isTransition(id)) {
std::shared_ptr<TransitionModel>trans = m_allTransitions.at(id);
} else if(isComposition(id)) {
std::shared_ptr<CompositionModel>compo = m_allCompositions.at(id);
switch (role) {
case NameRole:
case Qt::DisplayRole:
case ResourceRole:
case ServiceRole:
return trans->getProperty("mlt_service");
return compo->getProperty("mlt_service");
break;
case IsBlankRole: //probably useless
return false;
case StartRole:
return trans->getPosition();
return compo->getPosition();
case DurationRole:
return trans->getPlaytime();
return compo->getPlaytime();
case GroupedRole:
return false; //m_groups->isInGroup(id);
case InPointRole:
......@@ -340,7 +340,7 @@ QVariant TimelineItemModel::data(const QModelIndex &index, int role) const
QVariantList markersList;
return markersList;
}
case IsTransitionRole:
case IsCompositionRole:
return true;
default:
break;
......
......@@ -84,7 +84,7 @@ public:
HeightRole, /// track only
FadeInRole, /// clip only
FadeOutRole, /// clip only
IsTransitionRole,/// clip only
IsCompositionRole,/// clip only
FileHashRole, /// clip only
SpeedRole, /// clip only
ItemIdRole
......@@ -98,10 +98,10 @@ public:
//QModelIndex makeIndex(int trackIndex, int clipIndex) const;
/* @brief Creates an index based on the ID of the clip*/
QModelIndex makeClipIndexFromID(int cid) const override;
/* @brief Creates an index based on the ID of the transition*/
QModelIndex makeTransitionIndexFromID(int tid) const;
/* @brief Creates an index based on the ID of the compoition*/
QModelIndex makeCompositionIndexFromID(int tid) const;
/* @brief Creates an index based on the ID of the track*/
QModelIndex makeTrackIndexFromID(int tid, bool transition = false) const override;
QModelIndex makeTrackIndexFromID(int tid, bool composition = false) const override;
QModelIndex parent(const QModelIndex &index) const override;
Q_INVOKABLE void setTrackProperty(int tid, const QString &name, const QString &value);
void notifyChange(const QModelIndex& topleft, const QModelIndex& bottomright, bool start, bool duration, bool updateThumb) override;
......
This diff is collapsed.
......@@ -39,7 +39,7 @@
class TrackModel;
class ClipModel;
class TransitionModel;
class CompositionModel;
class GroupsModel;
class DocUndoStack;
class SnapModel;
......@@ -83,7 +83,7 @@ protected:
public:
friend class TrackModel;
friend class ClipModel;
friend class TransitionModel;
friend class CompositionModel;
friend class GroupsModel;
virtual ~TimelineModel();
......@@ -115,7 +115,7 @@ public:
@param trackId Id of the track to test
*/
int getTrackClipsCount(int trackId) const;
int getTrackTransitionsCount(int trackId) const;
int getTrackCompositionsCount(int trackId) const;
/* @brief Returns the position of the track in the order of the tracks
@param trackId Id of the track to test
......@@ -135,25 +135,25 @@ public:
*/
Q_INVOKABLE bool requestClipMove(int clipId, int trackId, int position, bool updateView = true, bool logUndo = true);
/* @brief Move a transition to a specific position
/* @brief Move a composition to a specific position
This action is undoable
Returns true on success. If it fails, nothing is modified.
If the clip is not in inserted in a track yet, it gets inserted for the first time.
If the clip is in a group, the call is deferred to requestGroupMove
@param transid is the ID of the transition
@param transid is the ID of the composition
@param trackId is the ID of the track
*/
Q_INVOKABLE bool requestTransitionMove(int compoId, int trackId, int position, bool updateView = true, bool logUndo = true);
Q_INVOKABLE bool requestCompositionMove(int compoId, int trackId, int position, bool updateView = true, bool logUndo = true);
int getTransitionTrackId(int compoId) const;
int getTransitionPosition(int compoId) const;
int getTransitionPlaytime(int compoId) const;
Q_INVOKABLE int suggestTransitionMove(int compoId, int trackId, int position);
int getCompositionTrackId(int compoId) const;
int getCompositionPosition(int compoId) const;
int getCompositionPlaytime(int compoId) const;
Q_INVOKABLE int suggestCompositionMove(int compoId, int trackId, int position);
protected:
/* Same function, but accumulates undo and redo, and doesn't check for group*/
bool requestClipMove(int clipId, int trackId, int position, bool updateView, Fun &undo, Fun &redo);
bool requestTransitionMove(int transid, int trackId, int position, bool updateView, Fun &undo, Fun &redo);
bool requestCompositionMove(int transid, int trackId, int position, bool updateView, Fun &undo, Fun &redo);
public:
/* @brief Given an intended move, try to suggest a more valid one (accounting for snaps and missing UI calls)
......@@ -304,13 +304,13 @@ public:
@param pos is the current position
*/
int requestPreviousSnapPos(int pos);
/* @brief Create a transition
/* @brief Create a composition
This action is undoable
Returns true on success. If it fails, nothing is modified.
@param trans the transition, containg all infos (position, track).
@param id is a return parameter that holds the id of the resulting transition (-1 on failure)
@param trans the composition, containg all infos (position, track).
@param id is a return parameter that holds the id of the resulting composition (-1 on failure)
*/
bool requestTransitionInsertion(std::shared_ptr<Mlt::Transition> trans, int trackId, int &id, Fun& undo, Fun& redo);
bool requestCompositionInsertion(std::shared_ptr<Mlt::Transition> trans, int trackId, int &id, Fun& undo, Fun& redo);
protected:
/* @brief Register a new track. This is a call-back meant to be called from TrackModel
......@@ -322,9 +322,9 @@ protected:
*/
void registerClip(std::shared_ptr<ClipModel> clip);
/* @brief Register a new transition. This is a call-back meant to be called from TransitionModel
/* @brief Register a new composition. This is a call-back meant to be called from CompositionModel
*/
void registerTransition(std::shared_ptr<TransitionModel> transition);
void registerComposition(std::shared_ptr<CompositionModel> composition);
/* @brief Register a new group. This is a call-back meant to be called from GroupsModel
*/
......@@ -340,9 +340,9 @@ protected:
*/
Fun deregisterClip_lambda(int id);
/* @brief Return a lambda that deregisters and destructs the transition with given id.
/* @brief Return a lambda that deregisters and destructs the composition with given id.
*/
Fun deregisterTransition_lambda(int compoId);
Fun deregisterComposition_lambda(int compoId);
/* @brief Deregister a group with given id
*/
......@@ -356,8 +356,8 @@ protected:
/*@brief Helper function to get a pointer to a clip, given its id*/
std::shared_ptr<ClipModel> getClipPtr(int clipId) const;
/*@brief Helper function to get a pointer to a transition, given its id*/
std::shared_ptr<TransitionModel> getTransitionPtr(int compoId) const;
/*@brief Helper function to get a pointer to a composition, given its id*/
std::shared_ptr<CompositionModel> getCompositionPtr(int compoId) const;
/* @brief Returns next valid unique id to create an object
*/
......@@ -367,9 +367,9 @@ protected:
*/
bool isClip(int id) const;
/* @brief Helper function that returns true if the given ID corresponds to a transition
/* @brief Helper function that returns true if the given ID corresponds to a composition
*/
bool isTransition(int id) const;
bool isComposition(int id) const;
/* @brief Helper function that returns true if the given ID corresponds to a track
*/
......@@ -379,8 +379,8 @@ protected:
*/
bool isGroup(int id) const;
void plantTransition(Mlt::Transition &tr, int a_track, int b_track);
bool removeTransition(int compoId, int pos);
void plantComposition(Mlt::Transition &tr, int a_track, int b_track);
bool removeComposition(int compoId, int pos);
protected:
std::unique_ptr<Mlt::Tractor> m_tractor;
......@@ -391,7 +391,7 @@ protected:
std::unordered_map<int, std::shared_ptr<ClipModel>> m_allClips; //the keys are the clip id, and the values are the corresponding pointers
std::unordered_map<int, std::shared_ptr<TransitionModel>> m_allTransitions; //the keys are the transition id, and the values are the corresponding pointers
std::unordered_map<int, std::shared_ptr<CompositionModel>> m_allCompositions; //the keys are the composition id, and the values are the corresponding pointers
static int next_id;//next valid id to assign
......@@ -419,8 +419,8 @@ protected:
virtual void _endInsertRows() = 0;
virtual void notifyChange(const QModelIndex& topleft, const QModelIndex& bottomright, bool start, bool duration, bool updateThumb) = 0;
virtual QModelIndex makeClipIndexFromID(int) const = 0;
virtual QModelIndex makeTransitionIndexFromID(int) const = 0;
virtual QModelIndex makeTrackIndexFromID(int, bool transition = false) const = 0;
virtual QModelIndex makeCompositionIndexFromID(int) const = 0;
virtual QModelIndex makeTrackIndexFromID(int, bool composition = false) const = 0;
virtual void _resetView() = 0;
};
#endif
......
......@@ -24,7 +24,7 @@
#include "trackmodel.hpp"
#include "clipmodel.hpp"
#include "transitionmodel.hpp"
#include "compositionmodel.hpp"
#include "groupsmodel.hpp"
#include "doc/docundostack.hpp"
#include <mlt++/MltTractor.h>
......
This diff is collapsed.
......@@ -31,7 +31,7 @@
class TimelineModel;
class ClipModel;
class TransitionModel;
class CompositionModel;
/* @brief This class represents a Track object, as viewed by the backend.
To allow same track transitions, a Track object corresponds to two Mlt::Playlist, between which we can switch when required by the transitions.
......@@ -61,8 +61,8 @@ public:
/* @brief returns the number of clips */
int getClipsCount();
/* @brief returns the number of transitions */
int getTransitionsCount() const;
/* @brief returns the number of compositions */
int getCompositionsCount() const;
/* Perform a split at the requested position */
bool splitClip(QSharedPointer<ClipModel> caller, int position);
......@@ -111,16 +111,16 @@ protected:
/* @brief This function returns a lambda that performs the requested operation */
Fun requestClipDeletion_lambda(int clipId, bool updateView);
bool requestTransitionDeletion(int compoId, bool updateView, Fun& undo, Fun& redo);
Fun requestTransitionDeletion_lambda(int compoId, bool updateView);
Fun requestTransitionResize_lambda(int compoId, int in, int out = -1);
bool requestCompositionDeletion(int compoId, bool updateView, Fun& undo, Fun& redo);
Fun requestCompositionDeletion_lambda(int compoId, bool updateView);
Fun requestCompositionResize_lambda(int compoId, int in, int out = -1);
/* @brief Returns the size of the blank before or after the given clip
@param clipId is the id of the clip
@param after is true if we query the blank after, false otherwise
*/
int getBlankSizeNearClip(int clipId, bool after);
int getBlankSizeNearTransition(int compoId, bool after);
int getBlankSizeNearComposition(int compoId, bool after);
/*@brief Returns the (unique) construction id of the track*/
int getId() const;
......@@ -133,16 +133,16 @@ protected:
/*@brief This function is used only by the QAbstractItemModel
Given a row in the model, retrieves the corresponding composition id. If it does not exist, returns -1
*/
int getTransitionByRow(int row) const;
int getCompositionByRow(int row) const;
/*@brief This function is used only by the QAbstractItemModel
Given a clip ID, returns the row of the clip.
*/
int getRowfromClip(int clipId) const;
/*@brief This function is used only by the QAbstractItemModel
Given a transition ID, returns the row of the transition.
Given a composition ID, returns the row of the composition.
*/
int getRowfromTransition(int compoId) const;
int getRowfromComposition(int compoId) const;
/*@brief This is an helper function that test frame level consistancy with the MLT structures */
bool checkConsistency();
......@@ -160,8 +160,8 @@ protected:
/* Same, but we restrict to a specific track*/
int getBlankEnd(int position, int track);
bool requestTransitionInsertion(int tid, int position, bool updateView, Fun& undo, Fun& redo);
Fun requestTransitionInsertion_lambda(int tid, int position, bool updateView);
bool requestCompositionInsertion(int tid, int position, bool updateView, Fun& undo, Fun& redo);
Fun requestCompositionInsertion_lambda(int tid, int position, bool updateView);
public slots:
/*Delete the current track and all its associated clips */
......@@ -180,8 +180,8 @@ private: