snprintf( minor, sizeof( minor ), "%d", info.minor_version );
mlt_properties_set_double( properties, "version", info.major_version + info.minor_version / pow( 10, strlen( minor ) ) );
+ // Use the global param name map for backwards compatibility when
+ // param names change and setting frei0r params by name instead of index.
+ mlt_properties param_name_map = mlt_properties_get_data( mlt_global_properties(), "frei0r.param_name_map", NULL );
+ if ( param_name_map ) {
+ // Lookup my plugin in the map
+ param_name_map = mlt_properties_get_data( param_name_map, name, NULL );
+ mlt_properties_set_data( properties, "_param_name_map", param_name_map, 0, NULL, NULL );
+ }
+
return ret;
}else{
mlt_log_error( NULL, "frei0r plugin \"%s\" is missing a function\n", name );
snprintf( dirname, PATH_MAX, "%s/frei0r/blacklist.txt", mlt_environment( "MLT_DATA" ) );
mlt_properties blacklist = mlt_properties_load( dirname );
+ // Load a param name map into global properties for backwards compatibility when
+ // param names change and setting frei0r params by name instead of index.
+ snprintf( dirname, PATH_MAX, "%s/frei0r/param_name_map.yml", mlt_environment( "MLT_DATA" ) );
+ mlt_properties_set_data( mlt_global_properties(), "frei0r.param_name_map",
+ mlt_properties_parse_yaml( dirname ), 0, (mlt_destructor) mlt_properties_close, NULL );
+
while (dircount--){
mlt_properties direntries = mlt_properties_new();
char *val = mlt_properties_get( prop , index );
if ( !val )
val = mlt_properties_get( prop , pinfo.name );
+ if ( !val ) {
+ // Use the backwards-compatibility param name map.
+ mlt_properties map = mlt_properties_get_data( prop, "_param_name_map", NULL );
+ if ( map ) {
+ int j;
+ for ( j = 0; !val && j < mlt_properties_count(map); j++ ) {
+ if ( !strcmp(mlt_properties_get_value(map, j), index) )
+ val = mlt_properties_get( prop , mlt_properties_get_name(map, j) );
+ }
+ }
+ }
if ( val ) {
switch (pinfo.type) {
case F0R_PARAM_DOUBLE: