[vlmc-devel] Commands: Fix split command

Hugo Beauzée-Luyssen git at videolan.org
Sun Oct 30 22:36:43 CET 2016


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sun Oct 30 19:50:31 2016 +0100| [9adcf3372d5f7565fb0619964800b99a69a5b9ad] | committer: Hugo Beauzée-Luyssen

Commands: Fix split command

> https://code.videolan.org/videolan/vlmc/commit/9adcf3372d5f7565fb0619964800b99a69a5b9ad
---

 src/Commands/Commands.cpp | 18 +++++++-----------
 src/Commands/Commands.h   |  2 +-
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/src/Commands/Commands.cpp b/src/Commands/Commands.cpp
index a0e7f5c..e20ee8f 100644
--- a/src/Commands/Commands.cpp
+++ b/src/Commands/Commands.cpp
@@ -320,7 +320,6 @@ Commands::Clip::Split::Split( std::shared_ptr<SequenceWorkflow> const& workflow,
     if ( !m_toSplit )
     {
         invalidate();
-        retranslate();
         return;
     }
     m_newClip = m_toSplit->clip->media()->cut( newClipBegin - m_toSplit->clip->begin(),
@@ -346,32 +345,29 @@ Commands::Clip::Split::internalRedo()
     //If we don't remove 1, the clip will end exactly at the starting frame (ie. they will
     //be rendering at the same time)
     bool ret = m_workflow->resizeClip( m_toSplit->uuid, m_toSplit->clip->begin(),
-                                       m_newClipBegin - 1, m_workflow->position( m_toSplit->uuid ) );
+                                       m_newClipBegin - 1, m_toSplit->pos );
     if ( ret == false )
     {
         invalidate();
         return;
     }
 
-    m_newClipUuid = m_workflow->addClip( m_newClip, m_trackId, m_newClipPos, m_newClipUuid, m_toSplit->isAudio );
-    if ( m_newClipUuid.isNull() == true )
+    m_newClipInstanceUuid = m_workflow->addClip( m_newClip, m_trackId, m_newClipPos, m_newClipInstanceUuid,
+                                                 m_toSplit->isAudio );
+    if ( m_newClipInstanceUuid.isNull() == true )
         invalidate();
-    emit Core::instance()->workflow()->clipResized( m_toSplit->uuid.toString() );
 }
 
 void
 Commands::Clip::Split::internalUndo()
 {
-    if ( m_workflow->removeClip( m_newClip->uuid() ) == nullptr )
+    if ( m_workflow->removeClip( m_newClipInstanceUuid ) == nullptr )
     {
         invalidate();
         return;
     }
-    else
-        emit Core::instance()->workflow()->clipRemoved( m_newClip->uuid().toString() );
-    m_workflow->resizeClip( m_toSplit->clip->uuid(), m_toSplit->clip->begin(),
-                            m_oldEnd, m_workflow->position( m_toSplit->uuid ) );
-    emit Core::instance()->workflow()->clipResized( m_toSplit->uuid.toString() );
+    m_workflow->resizeClip( m_toSplit->uuid, m_toSplit->clip->begin(),
+                            m_oldEnd, m_toSplit->pos );
 }
 
 Commands::Clip::Link::Link( std::shared_ptr<SequenceWorkflow> const& workflow,
diff --git a/src/Commands/Commands.h b/src/Commands/Commands.h
index 0afca5e..656d637 100644
--- a/src/Commands/Commands.h
+++ b/src/Commands/Commands.h
@@ -185,7 +185,7 @@ namespace Commands
                 QSharedPointer<SequenceWorkflow::ClipInstance>  m_toSplit;
                 quint32                           m_trackId;
                 QSharedPointer<::Clip>      m_newClip;
-                QUuid                       m_newClipUuid;
+                QUuid                       m_newClipInstanceUuid;
                 qint64                      m_newClipPos;
                 qint64                      m_newClipBegin;
                 qint64                      m_oldEnd;



More information about the Vlmc-devel mailing list