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

Commands: Link audio & video clip as part of the Add command

parent 244e2123
......@@ -124,6 +124,8 @@ Commands::Clip::Add::internalRedo()
if ( m_videoInstanceUuid.isNull() == true )
invalidate();
}
if ( m_audioInstanceUuid.isNull() == false && m_videoInstanceUuid.isNull() == false )
m_workflow->linkClips( m_audioInstanceUuid, m_videoInstanceUuid );
}
void
......
......@@ -151,9 +151,6 @@ Item {
removeClipFromTrack( "Video", trackId, "videoUuid" );
}
workflow.addClip( drop.getDataAsString("vlmc/uuid"), trackId, pos, false );
if ( audioClipUuid && videoClipUuid ) {
workflow.linkClips( audioClipUuid, videoClipUuid );
}
currentUuid = "";
aClipInfo = null;
vClipInfo = null;
......
......@@ -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::clipLinked, this, &MainWorkflow::clipLinked );
m_renderer->setInput( m_sequenceWorkflow->input() );
connect( m_renderer->eventWatcher(), &RendererEventWatcher::lengthChanged, this, &MainWorkflow::lengthChanged );
......
......@@ -166,6 +166,7 @@ SequenceWorkflow::linkClips( const QUuid& uuidA, const QUuid& uuidB )
}
clipA->linkedClips.append( clipB->uuid );
clipB->linkedClips.append( clipA->uuid );
emit clipLinked( clipA->uuid.toString(), clipB->uuid.toString() );
return true;
}
......
......@@ -113,6 +113,7 @@ class SequenceWorkflow : public QObject
signals:
void clipAdded( QString );
void clipLinked( QString, 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