From 1423fd1db7b06078e41a0570d9b83593d69be9ed Mon Sep 17 00:00:00 2001 From: lilo_booter Date: Sat, 10 Jan 2004 18:56:01 +0000 Subject: [PATCH] inigo gets transitions git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@48 d19143bc-622f-0410-bfdd-b5b2a6649095 --- mlt/src/inigo/inigo.c | 27 ++++++++++++++++++++++++++- src/inigo/inigo.c | 27 ++++++++++++++++++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/mlt/src/inigo/inigo.c b/mlt/src/inigo/inigo.c index 02d2789..29465db 100644 --- a/mlt/src/inigo/inigo.c +++ b/mlt/src/inigo/inigo.c @@ -147,6 +147,20 @@ mlt_filter create_filter( mlt_field field, char *id, int track ) return filter; } +mlt_transition create_transition( mlt_field field, char *id, int track ) +{ + char *arg = strchr( id, ':' ); + if ( arg != NULL ) + *arg ++ = '\0'; + mlt_transition transition = mlt_factory_transition( id, arg ); + if ( transition != NULL ) + { + mlt_field_plant_transition( field, transition, track, track + 1 ); + track_service( field, transition, ( mlt_destructor )mlt_transition_close ); + } + return transition; +} + void set_properties( mlt_properties properties, char *namevalue ) { mlt_properties_parse( properties, namevalue ); @@ -218,13 +232,22 @@ int main( int argc, char **argv ) } else if ( !strcmp( argv[ i ], "-filter" ) ) { - mlt_filter filter = create_filter( field, argv[ ++ i ], 0 ); + mlt_filter filter = create_filter( field, argv[ ++ i ], track ); if ( filter != NULL ) { properties = mlt_filter_properties( filter ); mlt_properties_inherit( properties, group ); } } + else if ( !strcmp( argv[ i ], "-transition" ) ) + { + mlt_transition transition = create_transition( field, argv[ ++ i ], track ); + if ( transition != NULL ) + { + properties = mlt_transition_properties( transition ); + mlt_properties_inherit( properties, group ); + } + } else if ( !strcmp( argv[ i ], "-blank" ) ) { if ( producer != NULL ) @@ -294,6 +317,8 @@ int main( int argc, char **argv ) fprintf( stderr, "Usage: inigo [ -group [ name=value ]* ]\n" " [ -consumer id[:arg] [ name=value ]* ]\n" " [ -filter id[:arg] [ name=value ] * ]\n" + " [ -transition id[:arg] [ name=value ] * ]\n" + " [ -blank time ]\n" " [ producer [ name=value ] * ]+\n" ); } diff --git a/src/inigo/inigo.c b/src/inigo/inigo.c index 02d2789..29465db 100644 --- a/src/inigo/inigo.c +++ b/src/inigo/inigo.c @@ -147,6 +147,20 @@ mlt_filter create_filter( mlt_field field, char *id, int track ) return filter; } +mlt_transition create_transition( mlt_field field, char *id, int track ) +{ + char *arg = strchr( id, ':' ); + if ( arg != NULL ) + *arg ++ = '\0'; + mlt_transition transition = mlt_factory_transition( id, arg ); + if ( transition != NULL ) + { + mlt_field_plant_transition( field, transition, track, track + 1 ); + track_service( field, transition, ( mlt_destructor )mlt_transition_close ); + } + return transition; +} + void set_properties( mlt_properties properties, char *namevalue ) { mlt_properties_parse( properties, namevalue ); @@ -218,13 +232,22 @@ int main( int argc, char **argv ) } else if ( !strcmp( argv[ i ], "-filter" ) ) { - mlt_filter filter = create_filter( field, argv[ ++ i ], 0 ); + mlt_filter filter = create_filter( field, argv[ ++ i ], track ); if ( filter != NULL ) { properties = mlt_filter_properties( filter ); mlt_properties_inherit( properties, group ); } } + else if ( !strcmp( argv[ i ], "-transition" ) ) + { + mlt_transition transition = create_transition( field, argv[ ++ i ], track ); + if ( transition != NULL ) + { + properties = mlt_transition_properties( transition ); + mlt_properties_inherit( properties, group ); + } + } else if ( !strcmp( argv[ i ], "-blank" ) ) { if ( producer != NULL ) @@ -294,6 +317,8 @@ int main( int argc, char **argv ) fprintf( stderr, "Usage: inigo [ -group [ name=value ]* ]\n" " [ -consumer id[:arg] [ name=value ]* ]\n" " [ -filter id[:arg] [ name=value ] * ]\n" + " [ -transition id[:arg] [ name=value ] * ]\n" + " [ -blank time ]\n" " [ producer [ name=value ] * ]+\n" ); } -- 1.7.4.4