X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=mlt%2B%2B%2FCUSTOMISING;h=7fdce7f0c9439276079f314aa9ee6e4c35cbbf3c;hb=e6e1b9178bb65857ac64fdd866436abbf6db284b;hp=1fc4f2c01cf7e011c39591cf5f3397d306663fcd;hpb=2f1b696bd96dd00921b1f50e3458c2256b04310a;p=melted diff --git a/mlt++/CUSTOMISING b/mlt++/CUSTOMISING index 1fc4f2c..7fdce7f 100644 --- a/mlt++/CUSTOMISING +++ b/mlt++/CUSTOMISING @@ -320,7 +320,33 @@ OTHER MANIPULATIONS manipulated in the push method - for example, to remove a track from the output, we could do something like: - TBD + Response *push( char *command, Service *service ) + { + Playlist playlist( ( mlt_playlist )( unit( 0 )->get_data( "playlist" ) ) ); + Tractor *tractor( *service ); + if ( tractor.is_valid( ) && playlist.is_valid( ) ) + { + // Remove track 2 (NB: tracks are indexed from 0 like everything else) + Producer *producer = tractor.track( 2 ); + Playlist track( producer ); + + // If we have a valid track then hide video and audio + // This is a bit pattern - 1 is video, 2 is audio + if ( track.is_valid( ) ) + track.set( "hide", 3 ); + + // You need to delete the reference to the playlist producer here + delete producer; + + // Play it + playlist.lock( ); + playlist.clear( ); + playlist.append( producer ); + playlist.unlock( ); + return new Response( 200, "OK" ); + } + return new Response( 400, "Invalid" ); + } EVENT HANDLING @@ -330,7 +356,7 @@ EVENT HANDLING on 'consumer-frame-render' - this event is fired immediately before a frame is rendered. - TBD + See example in test/server.cpp DISABLING DVCP