Commit 2a7c5ca3 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Emit clipMoved from SequenceWorkflow and propagate it from MainWorkflow

parent 99031333
......@@ -171,9 +171,7 @@ void
Commands::Clip::Move::internalRedo()
{
auto ret = m_workflow->moveClip( m_uuid, m_newTrackId, m_newPos );
if ( ret == true )
emit Core::instance()->workflow()->clipMoved( m_uuid.toString() );
else
if ( ret == false )
invalidate();
}
......@@ -181,9 +179,7 @@ void
Commands::Clip::Move::internalUndo()
{
auto ret = m_workflow->moveClip( m_uuid, m_oldTrackId, m_oldPos );
if ( ret == true )
emit Core::instance()->workflow()->clipMoved( m_uuid.toString() );
else
if ( ret == false )
invalidate();
}
......
......@@ -64,6 +64,7 @@ MainWorkflow::MainWorkflow( Settings* projectSettings, int trackCount ) :
connect( m_sequenceWorkflow.get(), &SequenceWorkflow::clipAdded, this, &MainWorkflow::clipAdded );
connect( m_sequenceWorkflow.get(), &SequenceWorkflow::clipRemoved, this, &MainWorkflow::clipRemoved );
connect( m_sequenceWorkflow.get(), &SequenceWorkflow::clipLinked, this, &MainWorkflow::clipLinked );
connect( m_sequenceWorkflow.get(), &SequenceWorkflow::clipMoved, this, &MainWorkflow::clipMoved );
m_renderer->setInput( m_sequenceWorkflow->input() );
connect( m_renderer->eventWatcher(), &RendererEventWatcher::lengthChanged, this, &MainWorkflow::lengthChanged );
......
......@@ -107,6 +107,7 @@ SequenceWorkflow::moveClip( const QUuid& uuid, quint32 trackId, qint64 pos )
{
c->pos = pos;
}
emit clipMoved( uuid.toString() );
// TODO: If we detect collision too strictly, there will be a problem if we want to move multiple
// clips at the same time.
return ret;
......
......@@ -115,6 +115,7 @@ class SequenceWorkflow : public QObject
void clipAdded( QString );
void clipRemoved( QString );
void clipLinked( QString, QString );
void clipMoved( QString );
};
#endif // SEQUENCEWORKFLOW_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment