]> git.sesse.net Git - mlt/commitdiff
add mlt_producer_get_length_time()
authorDan Dennedy <dan@dennedy.org>
Sat, 31 Mar 2012 23:46:50 +0000 (16:46 -0700)
committerDan Dennedy <dan@dennedy.org>
Mon, 2 Apr 2012 01:42:15 +0000 (18:42 -0700)
More functions that return time strings will be added later.

src/framework/mlt_producer.c
src/framework/mlt_producer.h
src/mlt++/MltProducer.cpp
src/mlt++/MltProducer.h

index bffdc905b31ef0c32fed7bc2dbc930b99342fbbe..ff2a59394f84ed228ca4ca4c8c0bcfe1bfff27d4 100644 (file)
@@ -509,6 +509,21 @@ mlt_position mlt_producer_get_length( mlt_producer self )
        return mlt_properties_get_position( MLT_PRODUCER_PROPERTIES( self ), "length" );
 }
 
+/** Get the total, unedited length of the producer as a time string.
+ *
+ * The value returned by a live streaming producer is unknown.
+ *
+ * \public \memberof mlt_producer_s
+ * \param self a producer
+ * \param format the time value format
+ * \return the duration of the producer regardless of in and out points
+ */
+
+char* mlt_producer_get_length_time( mlt_producer self, mlt_time_format format )
+{
+    return mlt_properties_get_time( MLT_PRODUCER_PROPERTIES( self ), "length", format );
+}
+
 /** Prepare for next frame.
  *
  * Advance the play out position. If the speed is less than zero, it will
index 3ba4cacf6860f3fbaa28e809d13c8f85e6de8c76..0f942d8f2df710eba5c887c90e05a13b6c3d1ca4 100644 (file)
@@ -104,6 +104,7 @@ extern mlt_position mlt_producer_get_in( mlt_producer self );
 extern mlt_position mlt_producer_get_out( mlt_producer self );
 extern mlt_position mlt_producer_get_playtime( mlt_producer self );
 extern mlt_position mlt_producer_get_length( mlt_producer self );
+extern char* mlt_producer_get_length_time( mlt_producer self, mlt_time_format );
 extern void mlt_producer_prepare_next( mlt_producer self );
 extern int mlt_producer_attach( mlt_producer self, mlt_filter filter );
 extern int mlt_producer_detach( mlt_producer self, mlt_filter filter );
index 49ba11ae58dc0a77488491be68f81f54f6cc36b1..739649b8e4d71399fa15fd700386d404ccf5e668 100644 (file)
@@ -174,6 +174,11 @@ int Producer::get_length( )
        return mlt_producer_get_length( get_producer( ) );
 }
 
+char* Producer::get_length_time( mlt_time_format format )
+{
+       return mlt_producer_get_length_time( get_producer( ), format );
+}
+
 int Producer::get_playtime( )
 {
        return mlt_producer_get_playtime( get_producer( ) );
index dc0b03635a3c54b50b1e1b6223deaaffeb113e81..92695943d926cb9ce46f0da035573fe0bf27627c 100644 (file)
@@ -62,6 +62,7 @@ namespace Mlt
                        int get_in( );
                        int get_out( );
                        int get_length( );
+                       char* get_length_time( mlt_time_format = mlt_time_smpte );
                        int get_playtime( );
                        Producer *cut( int in = 0, int out = -1 );
                        bool is_cut( );