From b61d43804b15c0ddf8a3579cdcd2146105d9be26 Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Mon, 16 Aug 2004 21:35:59 +0000 Subject: [PATCH] More cleanups git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++@370 d19143bc-622f-0410-bfdd-b5b2a6649095 --- mlt++/README | 36 +++++++++++++++++++++++++----------- mlt++/src/MltFactory.cpp | 24 ++++++++++++++++++++++++ mlt++/src/MltFactory.h | 13 +++++++++---- mlt++/src/MltFilter.cpp | 1 - mlt++/src/MltPlaylist.cpp | 17 ----------------- mlt++/src/MltPlaylist.h | 1 - mlt++/src/MltProducer.cpp | 12 ++++++------ mlt++/src/MltProperties.cpp | 2 +- mlt++/src/MltProperties.h | 2 +- mlt++/src/MltService.cpp | 5 ----- mlt++/src/MltService.h | 1 - mlt++/src/MltTransition.cpp | 1 - mlt++/test/Makefile | 3 +++ 13 files changed, 69 insertions(+), 49 deletions(-) diff --git a/mlt++/README b/mlt++/README index d6d1b1c..b0c44c6 100644 --- a/mlt++/README +++ b/mlt++/README @@ -32,21 +32,31 @@ USAGE Factory methods: - mlt_factory_init => Mlt::Factory::init - mlt_factory_producer => Mlt::Factory::producer - etc + mlt_factory_init ==> Mlt::Factory::init + mlt_factory_producer ==> Mlt::Factory::producer + mlt_factory_filter ==> Mlt::Factory::filter + mlt_factory_transition ==> Mlt::Factory::transition + mlt_factory_consumer ==> Mlt::Factory::consumer + mlt_factory_close ==> Mlt::Factory::close + + NB: Factory usage for service construction is optional. Types: - mlt_producer ==> Mlt::Producer - mlt_consumer ==> Mlt::Consumer - etc + mlt_properties ==> Mlt::Properties + mlt_frame ==> Mlt::Frame + mlt_service ==> Mlt::Service + mlt_producer ==> Mlt::Producer + mlt_filter ==> Mlt::Filter + mlt_transition ==> Mlt::Transition + mlt_consumer ==> Mlt::Consumer Methods: - mlt_type_method ==> Mlt:Type.method - ie: mlt_playlist_append ==> Mlt::Playlist.append - etc + mlt_type_method ==> Mlt::Type.method + ie: mlt_playlist_append ==> Mlt::Playlist.append + + Parent methods are available directly on children. Additionally, you can specify: @@ -85,8 +95,8 @@ SPECIAL CASES Mlt::Service *Mlt::Service.consumer( ); - Note that you get an object back - it is never the original object, but a - wrapping object. This is done to keep consistency with the C api which may + Note that you get an object back - it is never the original c++ object, but + a wrapping object. This is done to keep consistency with the C api which may instantiate C instances - therefore it cannot be assumed that a C++ object exists for all mlt service instances. @@ -108,4 +118,8 @@ LIMITATIONS networks constructed can be serialised and used by existing applications which are based on the C API (such as miracle). +SWIG +---- + + Experimental swig bindings based on mlt++ are provided. diff --git a/mlt++/src/MltFactory.cpp b/mlt++/src/MltFactory.cpp index 748a534..e52f49a 100644 --- a/mlt++/src/MltFactory.cpp +++ b/mlt++/src/MltFactory.cpp @@ -19,6 +19,10 @@ */ #include "MltFactory.h" +#include "MltProducer.h" +#include "MltFilter.h" +#include "MltTransition.h" +#include "MltConsumer.h" using namespace Mlt; int Factory::init( char *arg ) @@ -26,6 +30,26 @@ int Factory::init( char *arg ) return mlt_factory_init( arg ); } +Producer *Factory::producer( char *id, char *arg ) +{ + return new Producer( id, arg ); +} + +Filter *Factory::filter( char *id, char *arg ) +{ + return new Filter( id, arg ); +} + +Transition *Factory::transition( char *id, char *arg ) +{ + return new Transition( id, arg ); +} + +Consumer *Factory::consumer( char *id, char *arg ) +{ + return new Consumer( id, arg ); +} + void Factory::close( ) { mlt_factory_close( ); diff --git a/mlt++/src/MltFactory.h b/mlt++/src/MltFactory.h index 82d173a..fe70c81 100644 --- a/mlt++/src/MltFactory.h +++ b/mlt++/src/MltFactory.h @@ -22,17 +22,22 @@ #define _MLTPP_FACTORY_H_ #include -#include "MltProducer.h" -#include "MltFilter.h" -#include "MltTransition.h" -#include "MltConsumer.h" namespace Mlt { + class Producer; + class Filter; + class Transition; + class Consumer; + class Factory { public: static int init( char *arg = NULL ); + static Producer *producer( char *id, char *arg = NULL ); + static Filter *filter( char *id, char *arg = NULL ); + static Transition *transition( char *id, char *arg = NULL ); + static Consumer *consumer( char *id, char *arg = NULL ); static void close( ); }; } diff --git a/mlt++/src/MltFilter.cpp b/mlt++/src/MltFilter.cpp index 3c51114..3c7536f 100644 --- a/mlt++/src/MltFilter.cpp +++ b/mlt++/src/MltFilter.cpp @@ -81,4 +81,3 @@ int Filter::get_track( ) return mlt_filter_get_track( get_filter( ) ); } - diff --git a/mlt++/src/MltPlaylist.cpp b/mlt++/src/MltPlaylist.cpp index 42fe74a..5509a58 100644 --- a/mlt++/src/MltPlaylist.cpp +++ b/mlt++/src/MltPlaylist.cpp @@ -37,22 +37,6 @@ ClipInfo::ClipInfo( mlt_playlist_clip_info *info ) : { } -ClipInfo::ClipInfo( Playlist &playlist, int index ) -{ - mlt_playlist_clip_info info; - mlt_playlist_get_clip_info( playlist.get_playlist( ), &info, index ); - clip = info.clip; - producer = new Producer( info.producer ); - service = new Service( info.service ); - start = info.start; - resource = strdup( info.resource ); - frame_in = info.frame_in; - frame_out = info.frame_out; - frame_count = info.frame_count; - length = info.length; - fps = info.fps; -} - ClipInfo::~ClipInfo( ) { delete producer; @@ -157,4 +141,3 @@ int Playlist::resize_clip( int clip, mlt_position in, mlt_position out ) return mlt_playlist_resize_clip( get_playlist( ), clip, in, out ); } - diff --git a/mlt++/src/MltPlaylist.h b/mlt++/src/MltPlaylist.h index 1a7de2a..e5aa977 100644 --- a/mlt++/src/MltPlaylist.h +++ b/mlt++/src/MltPlaylist.h @@ -35,7 +35,6 @@ namespace Mlt { public: ClipInfo( mlt_playlist_clip_info *info ); - ClipInfo( Playlist &playlist, int i ); ~ClipInfo( ); int clip; Producer *producer; diff --git a/mlt++/src/MltProducer.cpp b/mlt++/src/MltProducer.cpp index f2c0530..177c8e7 100644 --- a/mlt++/src/MltProducer.cpp +++ b/mlt++/src/MltProducer.cpp @@ -54,6 +54,12 @@ Producer::~Producer( ) if ( destroy ) mlt_producer_close( instance ); } + +mlt_producer Producer::get_producer( ) +{ + return instance; +} + mlt_service Producer::get_service( ) { return mlt_producer_service( get_producer( ) ); @@ -114,9 +120,3 @@ mlt_position Producer::get_playtime( ) return mlt_producer_get_playtime( get_producer( ) ); } -mlt_producer Producer::get_producer( ) -{ - return instance; -} - - diff --git a/mlt++/src/MltProperties.cpp b/mlt++/src/MltProperties.cpp index 6b468f4..8725d20 100644 --- a/mlt++/src/MltProperties.cpp +++ b/mlt++/src/MltProperties.cpp @@ -108,7 +108,7 @@ int Properties::set( char *name, void *value, int size, mlt_destructor destructo return mlt_properties_set_data( get_properties( ), name, value, size, destructor, serialiser ); } -int Properties::pass( Properties &that, char *prefix ) +int Properties::pass_values( Properties &that, char *prefix ) { return mlt_properties_pass( get_properties( ), that.get_properties( ), prefix ); } diff --git a/mlt++/src/MltProperties.h b/mlt++/src/MltProperties.h index 25016f3..ead92bf 100644 --- a/mlt++/src/MltProperties.h +++ b/mlt++/src/MltProperties.h @@ -51,7 +51,7 @@ namespace Mlt int set( char *name, int value ); int set( char *name, double value ); int set( char *name, void *value, int size, mlt_destructor destroy = NULL, mlt_serialiser serial = NULL ); - int pass( Properties &that, char *prefix ); + int pass_values( Properties &that, char *prefix ); int parse( char *namevalue ); char *get_name( int index ); char *get( int index ); diff --git a/mlt++/src/MltService.cpp b/mlt++/src/MltService.cpp index 27c4ea8..61034b8 100644 --- a/mlt++/src/MltService.cpp +++ b/mlt++/src/MltService.cpp @@ -36,10 +36,6 @@ Service::Service( mlt_service service ) : { } -Service::~Service( ) -{ -} - mlt_service Service::get_service( ) { return instance; @@ -72,4 +68,3 @@ Frame *Service::get_frame( int index ) return new Frame( frame ); } - diff --git a/mlt++/src/MltService.h b/mlt++/src/MltService.h index 297f954..ab863c1 100644 --- a/mlt++/src/MltService.h +++ b/mlt++/src/MltService.h @@ -39,7 +39,6 @@ namespace Mlt Service( ); Service( Service &service ); Service( mlt_service service ); - virtual ~Service( ); virtual mlt_service get_service( ); mlt_properties get_properties( ); int connect_producer( Service &producer, int index = 0 ); diff --git a/mlt++/src/MltTransition.cpp b/mlt++/src/MltTransition.cpp index 517abaf..f858614 100644 --- a/mlt++/src/MltTransition.cpp +++ b/mlt++/src/MltTransition.cpp @@ -56,4 +56,3 @@ mlt_service Transition::get_service( ) return mlt_transition_service( get_transition( ) ); } - diff --git a/mlt++/test/Makefile b/mlt++/test/Makefile index 58d48b6..9280251 100644 --- a/mlt++/test/Makefile +++ b/mlt++/test/Makefile @@ -6,3 +6,6 @@ play: play.o play.o: play.cpp +clean: + $(RM) play play.o + -- 1.7.4.4