*/
#include "MltProducer.h"
+#include "MltFilter.h"
using namespace Mlt;
Producer::Producer( ) :
instance = mlt_factory_producer( "fezzik", id != NULL ? id : service );
}
+Producer::Producer( Service &producer ) :
+ instance( NULL )
+{
+ mlt_service_type type = producer.type( );
+ if ( type == producer_type || type == playlist_type ||
+ type == tractor_type || type == multitrack_type )
+ {
+ instance = ( mlt_producer )producer.get_service( );
+ inc_ref( );
+ }
+}
+
Producer::Producer( mlt_producer producer ) :
instance( producer )
{
return mlt_producer_get_playtime( get_producer( ) );
}
+Producer *Producer::cut( int in, int out )
+{
+ mlt_producer producer = mlt_producer_cut( get_producer( ), in, out );
+ Producer *result = new Producer( producer );
+ mlt_producer_close( producer );
+ return result;
+}
+
+bool Producer::same_clip( Producer &that )
+{
+ return mlt_producer_cut_parent( get_producer( ) ) == mlt_producer_cut_parent( that.get_producer( ) );
+}
+
+bool Producer::runs_into( Producer &that )
+{
+ return same_clip( that ) && get_out( ) == ( that.get_in( ) - 1 );
+}