Commit 642569b3 authored by luyikei's avatar luyikei Committed by Hugo Beauzée-Luyssen

SequenceWorkflow: Duplicate a clip in addClip

Signed-off-by: Hugo Beauzée-Luyssen's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 72fc45dc
......@@ -33,6 +33,7 @@
#include "Main/Core.h"
#include "Library/Library.h"
#include "Tools/VlmcDebug.h"
#include "Media/Media.h"
SequenceWorkflow::SequenceWorkflow( size_t trackCount )
: m_multitrack( new Backend::MLT::MLTMultiTrack )
......@@ -76,12 +77,18 @@ SequenceWorkflow::addClip( QSharedPointer<Clip> const& clip, quint32 trackId, qi
QString
SequenceWorkflow::addClip( const QUuid& uuid, quint32 trackId, qint32 pos, bool isAudioClip )
{
auto newClip = Core::instance()->library()->clip( uuid );
if ( newClip == nullptr )
auto parentClip = Core::instance()->library()->clip( uuid );
if ( parentClip == nullptr )
{
vlmcCritical() << "Couldn't find an acceptable parent to be added.";
return QUuid().toString();
}
auto newClip = parentClip->media()->cut( parentClip->begin(), parentClip->end() );
if ( newClip == nullptr )
{
vlmcCritical() << "Couldn't duplicate the parent clip.";
return QUuid().toString();
}
if ( isAudioClip == true )
newClip->setFormats( Clip::Audio );
......
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