xml based westley serialisation
[melted] / src / framework / mlt_multitrack.c
index 47bc271..2faaf69 100644 (file)
@@ -61,6 +61,7 @@ mlt_multitrack mlt_multitrack_init( )
                        producer->get_frame = producer_get_frame;
                        mlt_properties_set_data( properties, "multitrack", this, 0, NULL, NULL );
                        mlt_properties_set( properties, "log_id", "multitrack" );
+                       mlt_properties_set( properties, "resource", "<multitrack>" );
                }
                else
                {
@@ -147,7 +148,7 @@ void mlt_multitrack_refresh( mlt_multitrack this )
 
        // Update multitrack properties now - we'll not destroy the in point here
        mlt_properties_set_position( properties, "length", length );
-       mlt_properties_set_position( properties, "out", length );
+       mlt_properties_set_position( properties, "out", length - 1 );
        mlt_properties_set_double( properties, "fps", fps );
 }
 
@@ -188,6 +189,28 @@ int mlt_multitrack_connect( mlt_multitrack this, mlt_producer producer, int trac
        return result;
 }
 
+/** Get the number of tracks.
+*/
+
+int mlt_multitrack_count( mlt_multitrack this )
+{
+       return this->count;     
+}
+
+/** Get an individual track as a producer.
+*/
+
+mlt_producer mlt_multitrack_track( mlt_multitrack this, int track )
+{
+       mlt_producer producer = NULL;
+       
+       if ( this->list != NULL && track < this->count )
+               producer = this->list[ track ];
+
+       return producer;
+}
+
+
 /** Determine the clip point.
 
        Special case here: a 'producer' has no concept of multiple clips - only the 
@@ -298,7 +321,7 @@ static int producer_get_frame( mlt_producer parent, mlt_frame_ptr frame, int ind
                mlt_producer producer = this->list[ index ];
 
                // Obtain the current position
-               uint64_t position = mlt_producer_frame( parent );
+               mlt_position position = mlt_producer_frame( parent );
 
                // Make sure we're at the same point
                mlt_producer_seek( producer, position );