if ( get_image != NULL )
{
- return get_image( this, buffer, format, width, height, writable );
+ int error = 0;
+ mlt_position position = mlt_frame_get_position( this );
+ error = get_image( this, buffer, format, width, height, writable );
+ mlt_frame_set_position( this, position );
+ return error;
}
else if ( mlt_properties_get_data( properties, "image", NULL ) != NULL )
{
return error;
}
+/** Add a transition to an existing mix.
+*/
+
+int mlt_playlist_mix_add( mlt_playlist this, int clip, mlt_transition transition )
+{
+ mlt_producer producer = mlt_producer_cut_parent( mlt_playlist_get_clip( this, clip ) );
+ mlt_properties properties = producer != NULL ? mlt_producer_properties( producer ) : NULL;
+ mlt_tractor tractor = properties != NULL ? mlt_properties_get_data( properties, "mlt_mix", NULL ) : NULL;
+ int error = transition == NULL || tractor == NULL;
+ if ( error == 0 )
+ {
+ mlt_field field = mlt_tractor_field( tractor );
+ mlt_field_plant_transition( field, transition, 0, 1 );
+ mlt_transition_set_in_and_out( transition, 0, this->list[ clip ]->frame_count - 1 );
+ }
+ return error;
+}
+
+/** Return the clip at the position.
+*/
+
+mlt_producer mlt_playlist_get_clip( mlt_playlist this, int clip )
+{
+ if ( clip > 0 && clip < this->count )
+ return this->list[ clip ]->producer;
+ return NULL;
+}
+
+/** Determine if the clip is a mix.
+*/
+
+int mlt_playlist_clip_is_mix( mlt_playlist this, int clip )
+{
+ mlt_producer producer = mlt_producer_cut_parent( mlt_playlist_get_clip( this, clip ) );
+ mlt_properties properties = producer != NULL ? mlt_producer_properties( producer ) : NULL;
+ mlt_tractor tractor = properties != NULL ? mlt_properties_get_data( properties, "mlt_mix", NULL ) : NULL;
+ return tractor != NULL;
+}
+
/** Remove a mixed clip - ensure that the cuts included in the mix find their way
back correctly on to the playlist.
*/
extern int mlt_playlist_split( mlt_playlist self, int clip, mlt_position position );
extern int mlt_playlist_join( mlt_playlist self, int clip, int count, int merge );
extern int mlt_playlist_mix( mlt_playlist self, int clip, int length, mlt_transition transition );
+extern int mlt_playlist_mix_add( mlt_playlist self, int clip, mlt_transition transition );
+extern mlt_producer mlt_playlist_get_clip( mlt_playlist self, int clip );
+extern int mlt_playlist_clip_is_mix( mlt_playlist self, int clip );
extern void mlt_playlist_close( mlt_playlist self );
#endif