X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=mlt%2B%2B%2Fsrc%2FMltTractor.cpp;fp=mlt%2B%2B%2Fsrc%2FMltTractor.cpp;h=461b33d7ab6f15326b195cce0b6ca165c175f145;hb=abc4d14957a257a91fcab8177d91d5a067450afd;hp=d7bd8d6e332c8476a3b8f993339f26b6c2184ddc;hpb=cdf2dbd4142d046054baf2f675ff5bec30bb449a;p=melted diff --git a/mlt++/src/MltTractor.cpp b/mlt++/src/MltTractor.cpp index d7bd8d6..461b33d 100644 --- a/mlt++/src/MltTractor.cpp +++ b/mlt++/src/MltTractor.cpp @@ -23,6 +23,7 @@ #include "MltField.h" #include "MltTransition.h" #include "MltFilter.h" +#include "MltPlaylist.h" using namespace Mlt; Tractor::Tractor( ) : @@ -119,3 +120,23 @@ void Tractor::plant_filter( Filter *filter, int track ) mlt_field_plant_filter( mlt_tractor_field( get_tractor( ) ), filter->get_filter( ), track ); } +bool Tractor::locate_cut( Producer *producer, int &track, int &cut ) +{ + bool found = false; + + for ( track = 0; producer != NULL && !found && track < count( ); track ++ ) + { + Playlist playlist( ( mlt_playlist )mlt_tractor_get_track( get_tractor( ), track ) ); + for ( cut = 0; !found && cut < playlist.count( ); cut ++ ) + { + Producer *clip = playlist.get_clip( cut ); + found = producer->get_producer( ) == clip->get_producer( ); + delete clip; + } + } + + track --; + cut --; + + return found; +}