More cleanups
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 16 Aug 2004 21:35:59 +0000 (21:35 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 16 Aug 2004 21:35:59 +0000 (21:35 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++@370 d19143bc-622f-0410-bfdd-b5b2a6649095

13 files changed:
mlt++/README
mlt++/src/MltFactory.cpp
mlt++/src/MltFactory.h
mlt++/src/MltFilter.cpp
mlt++/src/MltPlaylist.cpp
mlt++/src/MltPlaylist.h
mlt++/src/MltProducer.cpp
mlt++/src/MltProperties.cpp
mlt++/src/MltProperties.h
mlt++/src/MltService.cpp
mlt++/src/MltService.h
mlt++/src/MltTransition.cpp
mlt++/test/Makefile

index d6d1b1c..b0c44c6 100644 (file)
@@ -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.
 
index 748a534..e52f49a 100644 (file)
  */
 
 #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( );
index 82d173a..fe70c81 100644 (file)
 #define _MLTPP_FACTORY_H_
 
 #include <framework/mlt.h>
-#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( );
        };
 }
index 3c51114..3c7536f 100644 (file)
@@ -81,4 +81,3 @@ int Filter::get_track( )
        return mlt_filter_get_track( get_filter( ) );
 }
 
-
index 42fe74a..5509a58 100644 (file)
@@ -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 );
 }
 
-
index 1a7de2a..e5aa977 100644 (file)
@@ -35,7 +35,6 @@ namespace Mlt
        {
                public:
                        ClipInfo( mlt_playlist_clip_info *info );
-                       ClipInfo( Playlist &playlist, int i );
                        ~ClipInfo( );
                        int clip;
                        Producer *producer;
index f2c0530..177c8e7 100644 (file)
@@ -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;
-}
-
-
index 6b468f4..8725d20 100644 (file)
@@ -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 );
 }
index 25016f3..ead92bf 100644 (file)
@@ -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 );
index 27c4ea8..61034b8 100644 (file)
@@ -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 );
 }
 
-
index 297f954..ab863c1 100644 (file)
@@ -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 );
index 517abaf..f858614 100644 (file)
@@ -56,4 +56,3 @@ mlt_service Transition::get_service( )
        return mlt_transition_service( get_transition( ) );
 }
 
-
index 58d48b6..9280251 100644 (file)
@@ -6,3 +6,6 @@ play:   play.o
 
 play.o:        play.cpp
 
+clean:
+       $(RM) play play.o
+