int mlt_tractor_connect( mlt_tractor self, mlt_service producer ) { int ret = mlt_service_connect_producer( MLT_TRACTOR_SERVICE( self ), producer, 0 ); // This is the producer we're going to connect to if ( ret == 0 ) self->producer = producer; return ret; }
int mlt_tractor_remove_track( mlt_tractor self, int index ) { int error = mlt_multitrack_disconnect( mlt_tractor_multitrack( self ), index ); if ( !error ) { // Update the track indices of transitions and track filters. mlt_service service = mlt_service_producer( MLT_TRACTOR_SERVICE( self ) ); while ( service ) { mlt_service_type type = mlt_service_identify( service ); mlt_properties properties = MLT_SERVICE_PROPERTIES( service ); if ( type == transition_type ) { mlt_transition transition = MLT_TRANSITION( service ); int a_track = mlt_transition_get_a_track( transition ); int b_track = mlt_transition_get_b_track( transition ); if ( a_track >= index || b_track >= index ) { a_track = MAX( a_track >= index ? a_track - 1 : a_track, 0 ); b_track = MAX( b_track >= index ? b_track - 1 : b_track, 0 ); mlt_transition_set_tracks( transition, a_track, b_track ); } } else if ( type == filter_type ) { int current_track = mlt_properties_get_int( properties, "track" ); if ( current_track >= index ) mlt_properties_set_int( properties, "track", MAX( current_track - 1, 0 ) ); } service = mlt_service_producer( service ); } } return error; }
mlt_service mlt_field_service( mlt_field self ) { return MLT_TRACTOR_SERVICE( self->tractor ); }