Ejemplo n.º 1
0
mlt_producer mlt_tractor_get_track( mlt_tractor self, int index )
{
	return mlt_multitrack_track( mlt_tractor_multitrack( self ), index );
}
Ejemplo n.º 2
0
int mlt_parser_start( mlt_parser self, mlt_service object )
{
	int error = 0;
	mlt_service_type type = mlt_service_identify( object );
	switch( type )
	{
		case invalid_type:
			error = self->on_invalid( self, object );
			break;
		case unknown_type:
			error = self->on_unknown( self, object );
			break;
		case producer_type:
			if ( mlt_producer_is_cut( ( mlt_producer )object ) )
				error = mlt_parser_start( self, ( mlt_service )mlt_producer_cut_parent( ( mlt_producer )object ) );
			error = self->on_start_producer( self, ( mlt_producer )object );
			if ( error == 0 )
			{
				int i = 0;
				while ( error == 0 && mlt_producer_filter( ( mlt_producer )object, i ) != NULL )
					error = mlt_parser_start( self, ( mlt_service )mlt_producer_filter( ( mlt_producer )object, i ++ ) );
			}
			error = self->on_end_producer( self, ( mlt_producer )object );
			break;
		case playlist_type:
			error = self->on_start_playlist( self, ( mlt_playlist )object );
			if ( error == 0 )
			{
				int i = 0;
				while ( error == 0 && i < mlt_playlist_count( ( mlt_playlist )object ) )
					mlt_parser_start( self, ( mlt_service )mlt_playlist_get_clip( ( mlt_playlist )object, i ++ ) );
				i = 0;
				while ( error == 0 && mlt_producer_filter( ( mlt_producer )object, i ) != NULL )
					error = mlt_parser_start( self, ( mlt_service )mlt_producer_filter( ( mlt_producer )object, i ++ ) );
			}
			error = self->on_end_playlist( self, ( mlt_playlist )object );
			break;
		case tractor_type:
			error = self->on_start_tractor( self, ( mlt_tractor )object );
			if ( error == 0 )
			{
				int i = 0;
				mlt_service next = mlt_service_producer( object );
				mlt_parser_start( self, ( mlt_service )mlt_tractor_multitrack( ( mlt_tractor )object ) );
				while ( next != ( mlt_service )mlt_tractor_multitrack( ( mlt_tractor )object ) )
				{
					mlt_parser_start( self, next );
					next = mlt_service_producer( next );
				}
				while ( error == 0 && mlt_producer_filter( ( mlt_producer )object, i ) != NULL )
					error = mlt_parser_start( self, ( mlt_service )mlt_producer_filter( ( mlt_producer )object, i ++ ) );
			}
			error = self->on_end_tractor( self, ( mlt_tractor )object );
			break;
		case multitrack_type:
			error = self->on_start_multitrack( self, ( mlt_multitrack )object );
			if ( error == 0 )
			{
				int i = 0;
				while ( i < mlt_multitrack_count( ( mlt_multitrack )object ) )
				{
					self->on_start_track( self );
					mlt_parser_start( self, ( mlt_service )mlt_multitrack_track( ( mlt_multitrack )object , i ++ ) );
					self->on_end_track( self );
				}
				i = 0;
				while ( error == 0 && mlt_producer_filter( ( mlt_producer )object, i ) != NULL )
					error = mlt_parser_start( self, ( mlt_service )mlt_producer_filter( ( mlt_producer )object, i ++ ) );
			}
			error = self->on_end_multitrack( self, ( mlt_multitrack )object );
			break;
		case filter_type:
			error = self->on_start_filter( self, ( mlt_filter )object );
			if ( error == 0 )
			{
				int i = 0;
				while ( error == 0 && mlt_producer_filter( ( mlt_producer )object, i ) != NULL )
					error = mlt_parser_start( self, ( mlt_service )mlt_producer_filter( ( mlt_producer )object, i ++ ) );
			}
			error = self->on_end_filter( self, ( mlt_filter )object );
			break;
		case transition_type:
			error = self->on_start_transition( self, ( mlt_transition )object );
			if ( error == 0 )
			{
				int i = 0;
				while ( error == 0 && mlt_producer_filter( ( mlt_producer )object, i ) != NULL )
					error = mlt_parser_start( self, ( mlt_service )mlt_producer_filter( ( mlt_producer )object, i ++ ) );
			}
			error = self->on_end_transition( self, ( mlt_transition )object );
			break;
		case field_type:
			break;
		case consumer_type:
			break;
	}
	return error;
}