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

Emit clipRemoved from SequenceWorkflow and propagate it through MainWorkflow

parent aa7bc8d5
......@@ -131,20 +131,12 @@ Commands::Clip::Add::internalRedo()
void
Commands::Clip::Add::internalUndo()
{
if ( m_audioInstanceUuid.isNull() == false )
{
if ( m_workflow->removeClip( m_audioInstanceUuid ) != nullptr )
emit Core::instance()->workflow()->clipRemoved( m_audioInstanceUuid.toString() );
else
if ( m_audioInstanceUuid.isNull() == false &&
m_workflow->removeClip( m_audioInstanceUuid ) == nullptr )
invalidate();
}
if ( m_videoInstanceUuid.isNull() == false )
{
if ( m_workflow->removeClip( m_videoInstanceUuid ) != nullptr )
emit Core::instance()->workflow()->clipRemoved( m_videoInstanceUuid.toString() );
else
if ( m_videoInstanceUuid.isNull() == false &&
m_workflow->removeClip( m_videoInstanceUuid ) == nullptr )
invalidate();
}
}
void
......
......@@ -62,6 +62,7 @@ MainWorkflow::MainWorkflow( Settings* projectSettings, int trackCount ) :
m_sequenceWorkflow( new SequenceWorkflow( 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 );
m_renderer->setInput( m_sequenceWorkflow->input() );
......
......@@ -136,6 +136,7 @@ SequenceWorkflow::resizeClip( const QUuid& uuid, qint64 newBegin, qint64 newEnd,
QSharedPointer<SequenceWorkflow::Clip>
SequenceWorkflow::removeClip( const QUuid& uuid )
{
vlmcDebug() << "Removing clip instance" << uuid;
auto it = m_clips.find( uuid );
if ( it == m_clips.end() )
{
......@@ -150,6 +151,7 @@ SequenceWorkflow::removeClip( const QUuid& uuid )
t->remove( t->clipIndexAt( position ) );
m_clips.erase( it );
clip->disconnect( this );
emit clipRemoved( uuid.toString() );
return c;
}
......
......@@ -113,6 +113,7 @@ class SequenceWorkflow : public QObject
signals:
void clipAdded( QString );
void clipRemoved( QString );
void clipLinked( QString, QString );
};
......
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