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:
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.
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.
*/
#include "MltFactory.h"
+#include "MltProducer.h"
+#include "MltFilter.h"
+#include "MltTransition.h"
+#include "MltConsumer.h"
using namespace Mlt;
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( );
#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( );
};
}
return mlt_filter_get_track( get_filter( ) );
}
-
{
}
-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;
return mlt_playlist_resize_clip( get_playlist( ), clip, in, out );
}
-
{
public:
ClipInfo( mlt_playlist_clip_info *info );
- ClipInfo( Playlist &playlist, int i );
~ClipInfo( );
int clip;
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( ) );
return mlt_producer_get_playtime( get_producer( ) );
}
-mlt_producer Producer::get_producer( )
-{
- return instance;
-}
-
-
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 );
}
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 );
{
}
-Service::~Service( )
-{
-}
-
mlt_service Service::get_service( )
{
return instance;
return new Frame( frame );
}
-
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 );
return mlt_transition_service( get_transition( ) );
}
-
play.o: play.cpp
+clean:
+ $(RM) play play.o
+