Handy conversion functions for apps.
mlt_service_filter_count;
mlt_service_move_filter;
} MLT_0.8.8;
+
+MLT_0.9.2 {
+ mlt_properties_frames_to_time;
+ mlt_properties_time_to_frames;
+} MLT_0.9.0;
return NULL;
}
+/** Convert a frame count to a time string.
+ *
+ * Do not free the returned string. It's lifetime is controlled by the property.
+ * \public \memberof mlt_properties_s
+ * \param self a properties list
+ * \param frames the frame count to convert
+ * \param format the time format that you want
+ * \return the time string or NULL if error, e.g. there is no profile
+ */
+
+char *mlt_properties_frames_to_time( mlt_properties self, mlt_position frames, mlt_time_format format )
+{
+ const char *name = "_mlt_properties_time";
+ mlt_properties_set_position( self, name, frames );
+ return mlt_properties_get_time( self, name, format );
+}
+
+/** Convert a time string to a frame count.
+ *
+ * \public \memberof mlt_properties_s
+ * \param self a properties list
+ * \param time the time string to convert
+ * \return a frame count or a negative value if error, e.g. there is no profile
+ */
+
+mlt_position mlt_properties_time_to_frames( mlt_properties self, const char *time )
+{
+ const char *name = "_mlt_properties_time";
+ mlt_properties_set( self, name, time );
+ return mlt_properties_get_position( self, name );
+}
+
/** Convert a numeric property to a tuple of color components.
*
* If the property's string is red, green, blue, white, or black, then it
extern char *mlt_properties_serialise_yaml( mlt_properties self );
extern void mlt_properties_lock( mlt_properties self );
extern void mlt_properties_unlock( mlt_properties self );
+
extern char *mlt_properties_get_time( mlt_properties, const char* name, mlt_time_format );
+extern char *mlt_properties_frames_to_time( mlt_properties, mlt_position, mlt_time_format );
+extern mlt_position mlt_properties_time_to_frames( mlt_properties, const char* time );
+
extern mlt_color mlt_properties_get_color( mlt_properties, const char* name );
extern int mlt_properties_set_color( mlt_properties, const char* name, mlt_color value );
return mlt_properties_get_time( get_properties(), name, format );
}
+char *Properties::frames_to_time( int frames, mlt_time_format format )
+{
+ return mlt_properties_frames_to_time( get_properties(), frames, format );
+}
+
+int Properties::time_to_frames( const char *time )
+{
+ return mlt_properties_time_to_frames( get_properties(), time );
+}
+
mlt_color Properties::get_color( const char *name )
{
return mlt_properties_get_color( get_properties(), name );
int set_lcnumeric( const char *locale );
const char *get_lcnumeric( );
char *get_time( const char *name, mlt_time_format = mlt_time_smpte );
+ char *frames_to_time( int, mlt_time_format = mlt_time_smpte );
+ int time_to_frames( const char* time );
+
mlt_color get_color( const char *name );
int set( const char *name , mlt_color value );
"Mlt::Service::move_filter(int, int)";
};
} MLTPP_0.8.8;
+
+MLTPP_0.9.2 {
+ global:
+ extern "C++" {
+ "Mlt::Properties::frames_to_time(int, mlt_time_format)";
+ "Mlt::Properties::time_to_frames(char const*)";
+ };
+} MLTPP_0.9.0;