Copyright (C) 2004-2009 Ushodaya Enterprised Limited
Author: Charles Yates <charles.yates@pandora.be>
-Last Revision: 2009-05-08
+Author: Dan Dennedy <dan@dennedy.org>
+Last Revision: 2011-04-03
MELT
-query "filters" | "filter"=id List filters or show info about one
-query "producers" | "producer"=id List producers or show info about one
-query "transitions" | "transition"=id List transitions or show info about one
+ -query "profile" | "profile"=id List profiles or show info about one
-serialise [filename] Write the commands to a text file
-silent Do not display position/transport help
-split relative-frame Split the last cut into two cuts
" -query \"filters\" | \"filter\"=id List filters or show info about one\n"
" -query \"producers\" | \"producer\"=id List producers or show info about one\n"
" -query \"transitions\" | \"transition\"=id List transitions, show info about one\n"
+" -query \"profiles\" | \"profile\"=id List profiles, show info about one\n"
" -serialise [filename] Write the commands to a text file\n"
" -silent Do not display position/transport\n"
" -split relative-frame Split the last cut into two cuts\n"
fprintf( stderr, "...\n" );
}
+static void query_profiles()
+{
+ mlt_properties profiles = mlt_profile_list();
+ fprintf( stderr, "---\nprofiles:\n" );
+ if ( profiles )
+ {
+ int j;
+ for ( j = 0; j < mlt_properties_count( profiles ); j++ )
+ fprintf( stderr, " - %s\n", mlt_properties_get_name( profiles, j ) );
+ }
+ fprintf( stderr, "...\n" );
+ mlt_properties_close( profiles );
+}
+
+static void query_profile( const char *id )
+{
+ mlt_properties profiles = mlt_profile_list();
+ mlt_properties profile = mlt_properties_get_data( profiles, id, NULL );
+ if ( profile )
+ {
+ char *s = mlt_properties_serialise_yaml( profile );
+ fprintf( stderr, "%s", s );
+ free( s );
+ }
+ else
+ {
+ fprintf( stderr, "# No metadata for profile \"%s\"\n", id );
+ }
+ mlt_properties_close( profiles );
+}
+
static void on_fatal_error( mlt_properties owner, mlt_consumer consumer )
{
mlt_consumer_stop( consumer );
query_services( repo, producer_type );
else if ( !strcmp( pname, "transitions" ) || !strcmp( pname, "transition" ) )
query_services( repo, transition_type );
+ else if ( !strcmp( pname, "profiles" ) || !strcmp( pname, "profile" ) )
+ query_profiles();
else if ( !strncmp( pname, "consumer=", 9 ) )
query_metadata( repo, consumer_type, "consumer", strchr( pname, '=' ) + 1 );
query_metadata( repo, producer_type, "producer", strchr( pname, '=' ) + 1 );
else if ( !strncmp( pname, "transition=", 11 ) )
query_metadata( repo, transition_type, "transition", strchr( pname, '=' ) + 1 );
+ else if ( !strncmp( pname, "profile=", 8 ) )
+ query_profile( strchr( pname, '=' ) + 1 );
else
goto query_all;
}