From: lilo_booter Date: Mon, 22 Nov 2004 10:13:27 +0000 (+0000) Subject: More playlist modifications; service locking X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=3723979ad22879a279252dea99bda209b480d57e;p=melted More playlist modifications; service locking git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++@535 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/mlt++/src/MltPlaylist.cpp b/mlt++/src/MltPlaylist.cpp index 2f6314f..adace64 100644 --- a/mlt++/src/MltPlaylist.cpp +++ b/mlt++/src/MltPlaylist.cpp @@ -251,3 +251,49 @@ void Playlist::consolidate_blanks( int keep_length ) { return mlt_playlist_consolidate_blanks( get_playlist( ), keep_length ); } + +void Playlist::insert_blank( int clip, int length ) +{ + mlt_playlist_insert_blank( get_playlist( ), clip, length ); +} + +void Playlist::pad_blanks( int position, int length, int find ) +{ + mlt_playlist_pad_blanks( get_playlist( ), position, length, find ); +} + +int Playlist::insert_at( int position, Producer *producer, int mode ) +{ + return mlt_playlist_insert_at( get_playlist( ), position, producer->get_producer( ), mode ); +} + +int Playlist::insert_at( int position, Producer &producer, int mode ) +{ + return mlt_playlist_insert_at( get_playlist( ), position, producer.get_producer( ), mode ); +} + +int Playlist::clip_start( int clip ) +{ + return mlt_playlist_clip_start( get_playlist( ), clip ); +} + +int Playlist::blanks_from( int clip, int bounded ) +{ + return mlt_playlist_blanks_from( get_playlist( ), clip, bounded ); +} + +int Playlist::clip_length( int clip ) +{ + return mlt_playlist_clip_length( get_playlist( ), clip ); +} + +int Playlist::remove_region( int position, int length ) +{ + return mlt_playlist_remove_region( get_playlist( ), position, length ); +} + +int Playlist::move_region( int position, int length, int new_position ) +{ + return mlt_playlist_move_region( get_playlist( ), position, length, new_position ); +} + diff --git a/mlt++/src/MltPlaylist.h b/mlt++/src/MltPlaylist.h index bbb8b0e..75a3667 100644 --- a/mlt++/src/MltPlaylist.h +++ b/mlt++/src/MltPlaylist.h @@ -88,6 +88,15 @@ namespace Mlt bool is_blank( int clip ); void consolidate_blanks( int keep_length = 0 ); Producer *replace_with_blank( int clip ); + void insert_blank( int clip, int length ); + void pad_blanks( int position, int length, int find = 0 ); + int insert_at( int position, Producer *producer, int mode = 0 ); + int insert_at( int position, Producer &producer, int mode = 0 ); + int clip_start( int clip ); + int clip_length( int clip ); + int blanks_from( int clip, int bounded = 0 ); + int remove_region( int position, int length ); + int move_region( int position, int length, int new_position ); }; } diff --git a/mlt++/src/MltProducer.cpp b/mlt++/src/MltProducer.cpp index 8eae08c..54473e7 100644 --- a/mlt++/src/MltProducer.cpp +++ b/mlt++/src/MltProducer.cpp @@ -60,9 +60,17 @@ Producer::Producer( Producer &producer ) : inc_ref( ); } +Producer::Producer( Producer *producer ) : + instance( producer != NULL ? producer->get_producer( ) : NULL ) +{ + if ( is_valid( ) ) + inc_ref( ); +} + Producer::~Producer( ) { mlt_producer_close( instance ); + instance = NULL; } mlt_producer Producer::get_producer( ) diff --git a/mlt++/src/MltProducer.h b/mlt++/src/MltProducer.h index 2196ec7..d75cf72 100644 --- a/mlt++/src/MltProducer.h +++ b/mlt++/src/MltProducer.h @@ -40,6 +40,7 @@ namespace Mlt Producer( Service &producer ); Producer( mlt_producer producer ); Producer( Producer &producer ); + Producer( Producer *producer ); virtual ~Producer( ); virtual mlt_producer get_producer( ); mlt_producer get_parent( ); diff --git a/mlt++/src/MltProperties.cpp b/mlt++/src/MltProperties.cpp index fdda0e6..868b77a 100644 --- a/mlt++/src/MltProperties.cpp +++ b/mlt++/src/MltProperties.cpp @@ -78,12 +78,12 @@ int Properties::ref_count( ) void Properties::block( void *object ) { - mlt_events_block( get_properties( ), object ); + mlt_events_block( get_properties( ), object != NULL ? object : get_properties( ) ); } void Properties::unblock( void *object ) { - mlt_events_unblock( get_properties( ), object ); + mlt_events_unblock( get_properties( ), object != NULL ? object : get_properties( ) ); } void Properties::fire_event( const char *event ) diff --git a/mlt++/src/MltService.cpp b/mlt++/src/MltService.cpp index c349cf4..63509f4 100644 --- a/mlt++/src/MltService.cpp +++ b/mlt++/src/MltService.cpp @@ -58,6 +58,16 @@ mlt_properties Service::get_properties( ) return mlt_service_properties( get_service( ) ); } +void Service::lock( ) +{ + mlt_service_lock( get_service( ) ); +} + +void Service::unlock( ) +{ + mlt_service_unlock( get_service( ) ); +} + int Service::connect_producer( Service &producer, int index ) { return mlt_service_connect_producer( get_service( ), producer.get_service( ), index ); diff --git a/mlt++/src/MltService.h b/mlt++/src/MltService.h index 0e5af04..69dd989 100644 --- a/mlt++/src/MltService.h +++ b/mlt++/src/MltService.h @@ -42,6 +42,8 @@ namespace Mlt Service( mlt_service service ); virtual ~Service( ); virtual mlt_service get_service( ); + void lock( ); + void unlock( ); mlt_properties get_properties( ); int connect_producer( Service &producer, int index = 0 ); Service *consumer( ); diff --git a/mlt++/test/Makefile b/mlt++/test/Makefile index c70c476..00252e3 100644 --- a/mlt++/test/Makefile +++ b/mlt++/test/Makefile @@ -1,4 +1,4 @@ -CXXFLAGS=-Wall `mlt-config --cflags` -I ../src +CXXFLAGS=-Wall -g `mlt-config --cflags` -I ../src LDFLAGS=-L../src -lmlt++ CC=c++