]> git.sesse.net Git - mlt/commitdiff
Add mlt_properties_get_lcnumeric and Properties::get_lcnumeric
authorDan Dennedy <dan@dennedy.org>
Sat, 9 Jul 2011 19:50:55 +0000 (12:50 -0700)
committerDan Dennedy <dan@dennedy.org>
Sat, 9 Jul 2011 19:50:55 +0000 (12:50 -0700)
src/framework/mlt_properties.c
src/framework/mlt_properties.h
src/mlt++/MltProperties.cpp
src/mlt++/MltProperties.h

index 02dbd7f215b869256c800c3b465a4edc596447bf..f12a8c6f5043652ac281ef502577c96610ce48a3 100644 (file)
@@ -147,6 +147,29 @@ int mlt_properties_set_lcnumeric( mlt_properties self, const char *locale )
        return error;
 }
 
+/** Get the numeric locale for this properties object.
+ *
+ * \public \memberof mlt_properties_s
+ * \param self a properties list
+ * \return the locale name if this properties has a specific locale it is using, NULL otherwise
+ */
+
+const char* mlt_properties_get_lcnumeric( mlt_properties self )
+{
+       property_list *list = self->local;
+       const char *result = NULL;
+
+       if ( list->locale )
+       {
+#ifdef querylocale
+               result = querylocale( LC_NUMERIC, list->locale );
+#else
+               result = list->locale->__names[ LC_NUMERIC ];
+#endif
+       }
+       return result;
+}
+
 static int load_properties( mlt_properties self, const char *filename )
 {
        // Open the file
index d08c9b77b7819d2d7baaa3aba00425b327a6d1c9..57c653ff7ff725cda73574a815293765089d4977 100644 (file)
@@ -48,6 +48,7 @@ struct mlt_properties_s
 extern int mlt_properties_init( mlt_properties, void *child );
 extern mlt_properties mlt_properties_new( );
 extern int mlt_properties_set_lcnumeric( mlt_properties, const char *locale );
+extern const char* mlt_properties_get_lcnumeric( mlt_properties self );
 extern mlt_properties mlt_properties_load( const char *file );
 extern int mlt_properties_preset( mlt_properties self, const char *name );
 extern int mlt_properties_inc_ref( mlt_properties self );
index c7fcb6cfa3167793b28e55edba88b86da55e8392..f37f777aeedb127eaac9de689ec6782e1bad8571 100644 (file)
@@ -326,3 +326,8 @@ int Properties::set_lcnumeric( const char *locale )
 {
        return mlt_properties_set_lcnumeric( get_properties(), locale );
 }
+
+const char *Properties::get_lcnumeric( )
+{
+       return mlt_properties_get_lcnumeric( get_properties() );
+}
index af8cbbec4554b37b9bfa58019274bda7363aee70..5a8718c65a36be16cd76fce1d69162611a90607c 100644 (file)
@@ -95,6 +95,7 @@ namespace Mlt
                        char *serialise_yaml( );
                        int preset( const char *name );
                        int set_lcnumeric( const char *locale );
+                       const char *get_lcnumeric( );
        };
 }