[vlmc-devel] MainWorkflow: Implement removeClip

Yikai Lu git at videolan.org
Mon Jul 11 17:08:12 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Tue Jul 12 00:02:32 2016 +0900| [61fe7ae4e4415dcf0390184afe22abe37e0f97f1] | committer: Yikai Lu

MainWorkflow: Implement removeClip

> https://code.videolan.org/videolan/vlmc/commit/61fe7ae4e4415dcf0390184afe22abe37e0f97f1
---

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

diff --git a/src/Workflow/MainWorkflow.cpp b/src/Workflow/MainWorkflow.cpp
index 2bf73fa..045c64b 100644
--- a/src/Workflow/MainWorkflow.cpp
+++ b/src/Workflow/MainWorkflow.cpp
@@ -266,6 +266,21 @@ MainWorkflow::resizeClip( const QString& uuid, qint64 newBegin, qint64 newEnd, q
     }
 }
 
+void
+MainWorkflow::removeClip( const QString& uuid )
+{
+    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::Remove( clip, track( trackId) ) );
+        }
+    }
+}
+
 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 2e20735..65e9bd4 100644
--- a/src/Workflow/MainWorkflow.h
+++ b/src/Workflow/MainWorkflow.h
@@ -154,6 +154,9 @@ class   MainWorkflow : public QObject
         void                    resizeClip( const QString& uuid, qint64 newBegin,
                                             qint64 newEnd, qint64 newPos );
 
+        Q_INVOKABLE
+        void                    removeClip( const QString& uuid );
+
         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