This excludes the use of the RTTI to determine the real type of the object -
this can only be done by parsing the objects properties.
+ Non-NULL objects may be invalid - always use the is_valid method to
+ check validity before use.
+
LIMITATIONS
-----------
mlt_properties_close( instance );
}
+bool Properties::is_valid( )
+{
+ return get_properties( ) != NULL;
+}
+
int Properties::count( )
{
return mlt_properties_count( get_properties( ) );
{
public:
virtual mlt_properties get_properties( ) = 0;
+ bool is_valid( );
int count( );
char *get( char *name );
int get_int( char *name );
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 );
+
};
/** Instance class.
int main( int argc, char **argv )
{
Factory::init( NULL );
+ Producer *producer = Factory::producer( argv[ 1 ] );
+ if ( !producer->is_valid( ) )
+ {
+ cerr << "Can't construct producer for " << argv[ 1 ] << endl;
+ return 0;
+ }
Consumer *consumer = Factory::consumer( "sdl" );
consumer->set( "rescale", "none" );
- Producer *producer = Factory::producer( argv[ 1 ] );
Filter *filter = Factory::filter( "greyscale" );
filter->connect( *producer );
consumer->connect( *filter );