From caa3ad0c7c7cece4045e78484e0c7724706a01e3 Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Sat, 28 Aug 2004 07:06:02 +0000 Subject: [PATCH] Producer filter extraction method git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++@392 d19143bc-622f-0410-bfdd-b5b2a6649095 --- mlt++/src/MltPlaylist.cpp | 6 ++++++ mlt++/src/MltPlaylist.h | 1 + mlt++/src/MltProducer.cpp | 5 +++++ mlt++/src/MltProducer.h | 1 + mlt++/swig/mltpp.i | 1 + 5 files changed, 14 insertions(+), 0 deletions(-) diff --git a/mlt++/src/MltPlaylist.cpp b/mlt++/src/MltPlaylist.cpp index 15c27b3..f81fd6e 100644 --- a/mlt++/src/MltPlaylist.cpp +++ b/mlt++/src/MltPlaylist.cpp @@ -56,6 +56,12 @@ Playlist::Playlist( Playlist &playlist ) : inc_ref( ); } +Playlist::Playlist( Producer &producer ) : + instance( (mlt_playlist )producer.get_producer( ) ) +{ + inc_ref( ); +} + Playlist::Playlist( mlt_playlist playlist ) : instance( playlist ) { diff --git a/mlt++/src/MltPlaylist.h b/mlt++/src/MltPlaylist.h index 2bab978..904f6cd 100644 --- a/mlt++/src/MltPlaylist.h +++ b/mlt++/src/MltPlaylist.h @@ -56,6 +56,7 @@ namespace Mlt Playlist( ); Playlist( Playlist &playlist ); Playlist( mlt_playlist playlist ); + Playlist( Producer &producer ); virtual ~Playlist( ); virtual mlt_playlist get_playlist( ); mlt_producer get_producer( ); diff --git a/mlt++/src/MltProducer.cpp b/mlt++/src/MltProducer.cpp index 9aa27da..a12c1da 100644 --- a/mlt++/src/MltProducer.cpp +++ b/mlt++/src/MltProducer.cpp @@ -127,3 +127,8 @@ int Producer::detach( Filter &filter ) { return mlt_producer_detach( get_producer( ), filter.get_filter( ) ); } + +Filter *Producer::filter( int index ) +{ + return new Filter( mlt_producer_filter( get_producer( ), index ) ); +} diff --git a/mlt++/src/MltProducer.h b/mlt++/src/MltProducer.h index ade287c..3c85fd9 100644 --- a/mlt++/src/MltProducer.h +++ b/mlt++/src/MltProducer.h @@ -55,6 +55,7 @@ namespace Mlt int get_playtime( ); int attach( Filter &filter ); int detach( Filter &filter ); + Filter *filter( int index ); }; } diff --git a/mlt++/swig/mltpp.i b/mlt++/swig/mltpp.i index c14529f..b06d829 100644 --- a/mlt++/swig/mltpp.i +++ b/mlt++/swig/mltpp.i @@ -37,6 +37,7 @@ namespace Mlt { %newobject Service::producer( ); %newobject Service::consumer( ); %newobject Service::get_frame( int ); +%newobject Producer::filter( int ); %newobject Playlist::current( ); %newobject Playlist::clip_info( int ); } -- 1.7.4.4