X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Fwestley%2Fproducer_westley.c;h=1d427543622b06cc86d05035cfbacc527f604af8;hb=7cef152403bfa0ea30e4a3e102fe33bc75e508ab;hp=4e5bad86a77c868dc118355890aab53e2d5ec1c6;hpb=519393231e6ab626f19bd01d4622d1c3759fcc93;p=melted diff --git a/src/modules/westley/producer_westley.c b/src/modules/westley/producer_westley.c index 4e5bad8..1d42754 100644 --- a/src/modules/westley/producer_westley.c +++ b/src/modules/westley/producer_westley.c @@ -54,7 +54,7 @@ enum service_type mlt_transition_type, mlt_consumer_type, mlt_field_type, - mlt_service_type, + mlt_services_type, mlt_dummy_filter_type, mlt_dummy_transition_type, mlt_dummy_producer_type, @@ -639,8 +639,16 @@ static void on_start_entry( deserialise_context context, const xmlChar *name, co mlt_playlist_append( MLT_PLAYLIST( parent ), producer ); } + // Handle the repeat property + if ( mlt_properties_get_int( temp, "repeat" ) > 0 ) + { + mlt_playlist_repeat_clip( MLT_PLAYLIST( parent ), + mlt_playlist_count( MLT_PLAYLIST( parent ) ) - 1, + mlt_properties_get_int( temp, "repeat" ) ); + } + mlt_playlist_get_clip_info( MLT_PLAYLIST( parent ), &info, mlt_playlist_count( MLT_PLAYLIST( parent ) ) - 1 ); - entry = info.producer; + entry = info.cut; } else { @@ -718,18 +726,24 @@ static void on_end_track( deserialise_context context, const xmlChar *name ) if ( multitrack != NULL ) { - // Set the track on the multitrack - mlt_multitrack_connect( multitrack, producer, mlt_multitrack_count( multitrack ) ); - // Set producer i/o if specified if ( mlt_properties_get( track_props, "in" ) != NULL || - mlt_properties_get( track_props, "out" ) != NULL ) + mlt_properties_get( track_props, "out" ) != NULL ) { - mlt_producer_set_in_and_out( MLT_PRODUCER( producer ), + if ( mlt_properties_get( track_props, "out" ) == NULL ) + mlt_properties_set_position( track_props, "out", mlt_properties_get_position( track_props, "length" ) - 1 ); + mlt_producer cut = mlt_producer_cut( MLT_PRODUCER( producer ), mlt_properties_get_position( track_props, "in" ), mlt_properties_get_position( track_props, "out" ) ); + mlt_properties_set_int( mlt_producer_properties( cut ), "cut", 1 ); + mlt_multitrack_connect( multitrack, cut, mlt_multitrack_count( multitrack ) ); + mlt_producer_close( cut ); } - + else + { + mlt_multitrack_connect( multitrack, producer, mlt_multitrack_count( multitrack ) ); + } + // Set the hide state of the track producer char *hide_s = mlt_properties_get( track_props, "hide" ); if ( hide_s != NULL ) @@ -877,6 +891,8 @@ static void on_end_transition( deserialise_context context, const xmlChar *name if ( parent_type == mlt_tractor_type ) { mlt_field field = mlt_tractor_field( MLT_TRACTOR( parent ) ); + if ( mlt_properties_get_int( properties, "a_track" ) == mlt_properties_get_int( properties, "b_track" ) ) + mlt_properties_set_int( properties, "b_track", mlt_properties_get_int( properties, "a_track" ) + 1 ); mlt_field_plant_transition( field, MLT_TRANSITION( effect ), mlt_properties_get_int( properties, "a_track" ), mlt_properties_get_int( properties, "b_track" ) ); @@ -1370,6 +1386,9 @@ mlt_producer producer_westley_init( int info, char *data ) // Assign the title mlt_properties_set( properties, "title", title ); + // Optimise for overlapping producers + mlt_producer_optimise( MLT_PRODUCER( service ) ); + // Handle deep copies if ( getenv( "MLT_WESTLEY_DEEP" ) == NULL ) { @@ -1383,6 +1402,7 @@ mlt_producer producer_westley_init( int info, char *data ) else { // Allow the project to be edited + mlt_properties_set( properties, "_westley", "was here" ); mlt_properties_set_int( properties, "_mlt_service_hidden", 1 ); } }