[vlmc-devel] IMultiTrack: Implement a function to disable audio or video

Yikai Lu git at videolan.org
Mon Aug 7 19:18:17 CEST 2017


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Tue Aug  8 00:46:44 2017 +0900| [e0424acbbb0a21f0b50f91ef34963e447178e16f] | committer: Yikai Lu

IMultiTrack: Implement a function to disable audio or video

> https://code.videolan.org/videolan/vlmc/commit/e0424acbbb0a21f0b50f91ef34963e447178e16f
---

 src/Backend/IMultiTrack.h         | 2 ++
 src/Backend/MLT/MLTMultiTrack.cpp | 8 ++++++++
 src/Backend/MLT/MLTMultiTrack.h   | 1 +
 3 files changed, 11 insertions(+)

diff --git a/src/Backend/IMultiTrack.h b/src/Backend/IMultiTrack.h
index 542e9670..9ee843c2 100644
--- a/src/Backend/IMultiTrack.h
+++ b/src/Backend/IMultiTrack.h
@@ -24,6 +24,7 @@
 #define IMULTITRACK_H
 
 #include "IInput.h"
+#include "ITrack.h"
 
 namespace Backend
 {
@@ -44,6 +45,7 @@ namespace Backend
         virtual void        addTransition( ITransition& transition, int aTrack = 0, int bTrack = 1 ) = 0;
         virtual void        addFilter( IFilter& filter, int track = 0 ) = 0;
         virtual bool        connect( IInput& input ) = 0;
+        virtual void        hide( HideType hideType, int index ) = 0;
     };
 }
 
diff --git a/src/Backend/MLT/MLTMultiTrack.cpp b/src/Backend/MLT/MLTMultiTrack.cpp
index 89691bf4..fd36d68e 100644
--- a/src/Backend/MLT/MLTMultiTrack.cpp
+++ b/src/Backend/MLT/MLTMultiTrack.cpp
@@ -139,3 +139,11 @@ MLTMultiTrack::connect( Backend::IInput& input )
     assert( mltInput );
     return !tractor()->connect( *mltInput->producer() );
 }
+
+void
+MLTMultiTrack::hide( Backend::HideType hydeType, int index )
+{
+    auto prod = tractor()->track( index );
+    if ( prod )
+        prod->set( "hide", static_cast<int>( hydeType ) );
+}
diff --git a/src/Backend/MLT/MLTMultiTrack.h b/src/Backend/MLT/MLTMultiTrack.h
index b43ca7c9..63eb45c1 100644
--- a/src/Backend/MLT/MLTMultiTrack.h
+++ b/src/Backend/MLT/MLTMultiTrack.h
@@ -58,6 +58,7 @@ namespace MLT
         virtual void        addTransition( ITransition& transition, int aTrack, int bTrack ) override;
         virtual void        addFilter( IFilter& filter, int track ) override;
         virtual bool        connect( IInput& input ) override;
+        virtual void        hide( HideType hideType, int index ) override;
 
     private:
         Mlt::Tractor*      m_tractor;



More information about the Vlmc-devel mailing list