[vlmc-devel] MainWorkflow: Implement resizeClip

Yikai Lu git at videolan.org
Mon Jul 11 14:21:26 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Mon Jul 11 21:17:33 2016 +0900| [52167d0aebce4d6a134deb38e9f48883c72a066a] | committer: Yikai Lu

MainWorkflow: Implement resizeClip

> https://code.videolan.org/videolan/vlmc/commit/52167d0aebce4d6a134deb38e9f48883c72a066a
---

 src/Workflow/MainWorkflow.cpp | 15 +++++++++++++++
 src/Workflow/MainWorkflow.h   |  4 ++++
 2 files changed, 19 insertions(+)

diff --git a/src/Workflow/MainWorkflow.cpp b/src/Workflow/MainWorkflow.cpp
index 9c71bf5..2bf73fa 100644
--- a/src/Workflow/MainWorkflow.cpp
+++ b/src/Workflow/MainWorkflow.cpp
@@ -251,6 +251,21 @@ MainWorkflow::moveClip( quint32 trackId, const QString& uuid, qint64 startFrame
     }
 }
 
+void
+MainWorkflow::resizeClip( const QString& uuid, qint64 newBegin, qint64 newEnd, qint64 newPos )
+{
+    for ( auto it = m_clips.begin(); it != m_clips.end(); ++it )
+    {
+        if ( it.value()->uuid().toString() == uuid )
+        {
+            auto trackId = it.key();
+            auto clip = it.value();
+
+            Commands::trigger( new Commands::Clip::Resize( track( trackId ), clip, newBegin, newEnd, newPos ) );
+        }
+    }
+}
+
 bool
 MainWorkflow::startRenderToFile( const QString &outputFileName, quint32 width, quint32 height,
                                  double fps, const QString &ar, quint32 vbitrate, quint32 abitrate,
diff --git a/src/Workflow/MainWorkflow.h b/src/Workflow/MainWorkflow.h
index c21face..2e20735 100644
--- a/src/Workflow/MainWorkflow.h
+++ b/src/Workflow/MainWorkflow.h
@@ -150,6 +150,10 @@ class   MainWorkflow : public QObject
         Q_INVOKABLE
         void                    moveClip( quint32 trackId, const QString& uuid, qint64 startFrame );
 
+        Q_INVOKABLE
+        void                    resizeClip( const QString& uuid, qint64 newBegin,
+                                            qint64 newEnd, qint64 newPos );
+
         bool                    startRenderToFile( const QString& outputFileName, quint32 width, quint32 height,
                                                    double fps, const QString& ar, quint32 vbitrate, quint32 abitrate,
                                                    quint32 nbChannels, quint32 sampleRate );



More information about the Vlmc-devel mailing list