More playlist modifications; service locking
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 22 Nov 2004 10:13:27 +0000 (10:13 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 22 Nov 2004 10:13:27 +0000 (10:13 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt++@535 d19143bc-622f-0410-bfdd-b5b2a6649095

mlt++/src/MltPlaylist.cpp
mlt++/src/MltPlaylist.h
mlt++/src/MltProducer.cpp
mlt++/src/MltProducer.h
mlt++/src/MltProperties.cpp
mlt++/src/MltService.cpp
mlt++/src/MltService.h
mlt++/test/Makefile

index 2f6314f..adace64 100644 (file)
@@ -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 );
+}
+
index bbb8b0e..75a3667 100644 (file)
@@ -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 );
        };
 }
 
index 8eae08c..54473e7 100644 (file)
@@ -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( )
index 2196ec7..d75cf72 100644 (file)
@@ -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( );
index fdda0e6..868b77a 100644 (file)
@@ -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 )
index c349cf4..63509f4 100644 (file)
@@ -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 );
index 0e5af04..69dd989 100644 (file)
@@ -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( );
index c70c476..00252e3 100644 (file)
@@ -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++