Add a .gitignore file
[melted] / mlt++ / src / MltPlaylist.cpp
index adace64..10991c9 100644 (file)
@@ -44,7 +44,7 @@ ClipInfo::ClipInfo( mlt_playlist_clip_info *info ) :
        producer( new Producer( info->producer ) ),
        cut( new Producer( info->cut ) ),
        start( info->start ),
-       resource( strdup( info->resource ) ),
+       resource( info->resource? strdup( info->resource )  : 0 ),
        frame_in( info->frame_in ),
        frame_out( info->frame_out ),
        frame_count( info->frame_count ),
@@ -160,13 +160,19 @@ Producer *Playlist::current( )
 ClipInfo *Playlist::clip_info( int index, ClipInfo *info )
 {
        mlt_playlist_clip_info clip_info;
-       mlt_playlist_get_clip_info( get_playlist( ), &clip_info, index );
+       if ( mlt_playlist_get_clip_info( get_playlist( ), &clip_info, index ) )
+               return NULL;
        if ( info == NULL )
                return new ClipInfo( &clip_info );
        info->update( &clip_info );
        return info;
 }
 
+void Playlist::delete_clip_info( ClipInfo *info )
+{
+       delete info;
+}
+
 int Playlist::insert( Producer &producer, int where, int in, int out )
 {
        return mlt_playlist_insert( get_playlist( ), producer.get_producer( ), where, in, out );
@@ -192,6 +198,11 @@ int Playlist::split( int clip, int position )
        return mlt_playlist_split( get_playlist( ), clip, position );
 }
 
+int Playlist::split_at( int position, bool left )
+{
+       return mlt_playlist_split_at( get_playlist( ), position, left );
+}
+
 int Playlist::join( int clip, int count, int merge )
 {
        return mlt_playlist_join( get_playlist( ), clip, count, merge );
@@ -236,7 +247,12 @@ bool Playlist::is_mix( int clip )
 
 bool Playlist::is_blank( int clip )
 {
-       return mlt_playlist_is_blank( get_playlist( ), clip );
+       return mlt_playlist_is_blank( get_playlist( ), clip ) != 0;
+}
+
+bool Playlist::is_blank_at( int position )
+{
+       return mlt_playlist_is_blank_at( get_playlist( ), position ) != 0;
 }
 
 Producer *Playlist::replace_with_blank( int clip )