* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <stdlib.h>
+#include <string.h>
#include "MltConsumer.h"
using namespace Mlt;
-Consumer::Consumer( char *id, char *service ) :
+Consumer::Consumer( char *id, char *arg ) :
destroy( true ),
instance( NULL )
{
- instance = mlt_factory_consumer( id, service );
+ if ( arg != NULL )
+ {
+ instance = mlt_factory_consumer( id, arg );
+ }
+ else
+ {
+ if ( strchr( id, ':' ) )
+ {
+ char *temp = strdup( id );
+ char *arg = strchr( temp, ':' ) + 1;
+ *( arg - 1 ) = '\0';
+ instance = mlt_factory_consumer( temp, arg );
+ free( temp );
+ }
+ else
+ {
+ instance = mlt_factory_consumer( id, NULL );
+ }
+ }
}
Consumer::Consumer( Consumer &consumer ) :
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <stdlib.h>
+#include <string.h>
#include "MltFilter.h"
using namespace Mlt;
-Filter::Filter( char *id, char *service ) :
+Filter::Filter( char *id, char *arg ) :
destroy( true ),
instance( NULL )
{
- instance = mlt_factory_filter( id, service );
+ if ( arg != NULL )
+ {
+ instance = mlt_factory_filter( id, arg );
+ }
+ else
+ {
+ if ( strchr( id, ':' ) )
+ {
+ char *temp = strdup( id );
+ char *arg = strchr( temp, ':' ) + 1;
+ *( arg - 1 ) = '\0';
+ instance = mlt_factory_filter( temp, arg );
+ free( temp );
+ }
+ else
+ {
+ instance = mlt_factory_filter( id, NULL );
+ }
+ }
}
Filter::Filter( Filter &filter ) :
{
mlt_properties_dump( get_properties( ), output );
}
+
+int Properties::save( char *file )
+{
+ int error = 0;
+ FILE *f = fopen( file, "w" );
+ if ( f != NULL )
+ {
+ dump( f );
+ fclose( f );
+ }
+ else
+ {
+ error = 1;
+ }
+ return error;
+}
private:
bool destroy;
mlt_properties instance;
+ protected:
+ virtual mlt_properties get_properties( );
public:
Properties( );
Properties( Properties &properties );
Properties( mlt_properties properties );
Properties( char *file );
virtual ~Properties( );
- virtual mlt_properties get_properties( );
bool is_valid( );
int count( );
char *get( char *name );
int inherit( Properties &that );
int rename( char *source, char *dest );
void dump( FILE *output = stderr );
+ int save( char *file );
};
}
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+#include <stdlib.h>
+#include <string.h>
#include "MltTransition.h"
using namespace Mlt;
destroy( true ),
instance( NULL )
{
- instance = mlt_factory_transition( id, arg );
+ if ( arg != NULL )
+ {
+ instance = mlt_factory_transition( id, arg );
+ }
+ else
+ {
+ if ( strchr( id, ':' ) )
+ {
+ char *temp = strdup( id );
+ char *arg = strchr( temp, ':' ) + 1;
+ *( arg - 1 ) = '\0';
+ instance = mlt_factory_transition( temp, arg );
+ free( temp );
+ }
+ else
+ {
+ instance = mlt_factory_transition( id, NULL );
+ }
+ }
}
Transition::Transition( Transition &transition ) :