return 0;
}
-/** Allow the specification of a mirror.
+/** Mirror properties set on 'this' to 'that'.
*/
void mlt_properties_mirror( mlt_properties this, mlt_properties that )
return 0;
}
+
/** Locate a property by name
*/
return property;
}
+/** Pass property 'name' from 'that' to 'this'
+* Who to blame: Zach <zachary.drew@gmail.com>
+*/
+
+void mlt_properties_pass_property( mlt_properties this, mlt_properties that, const char *name )
+{
+ // Make sure the source property isn't null.
+ mlt_property that_prop = mlt_properties_find( that, name );
+ if( that_prop == NULL )
+ return;
+
+ mlt_property_pass( mlt_properties_fetch( this, name ), that_prop );
+}
+
+/** Pass all properties from 'that' to 'this' as found in comma seperated 'list'.
+* Who to blame: Zach <zachary.drew@gmail.com>
+*/
+
+int mlt_properties_pass_list( mlt_properties this, mlt_properties that, const char *list )
+{
+ char *props = strdup( list );
+ char *ptr = props;
+ char *delim = " ,\t\n"; // Any combination of spaces, commas, tabs, and newlines
+ int count, done = 0;
+
+ while( !done )
+ {
+ count = strcspn( ptr, delim );
+
+ if( ptr[count] == '\0' )
+ done = 1;
+ else
+ ptr[count] = '\0'; // Make it a real string
+
+ mlt_properties_pass_property( this, that, ptr );
+
+ ptr += count + 1;
+ ptr += strspn( ptr, delim );
+ }
+
+ free( props );
+
+ return 0;
+}
+
+
/** Set the property.
*/
extern void mlt_properties_mirror( mlt_properties self, mlt_properties that );
extern int mlt_properties_inherit( mlt_properties self, mlt_properties that );
extern int mlt_properties_pass( mlt_properties self, mlt_properties that, const char *prefix );
+extern void mlt_properties_pass_property( mlt_properties this, mlt_properties that, const char *name );
+extern int mlt_properties_pass_list( mlt_properties this, mlt_properties that, const char *list );
extern int mlt_properties_set( mlt_properties self, const char *name, const char *value );
extern int mlt_properties_set_or_default( mlt_properties self, const char *name, const char *value, const char *def );
extern int mlt_properties_parse( mlt_properties self, const char *namevalue );
free( this );
}
+/** Pass the property 'that' to 'this'.
+* Who to blame: Zach <zachary.drew@gmail.com>
+*/
+void mlt_property_pass( mlt_property this, mlt_property that )
+{
+ mlt_property_clear( this );
+
+ this->types = that->types;
+ if ( this->types & mlt_prop_int64 )
+ this->prop_int64 = that->prop_int64;
+ else if ( this->types & mlt_prop_int )
+ this->prop_int = that->prop_int;
+ else if ( this->types & mlt_prop_double )
+ this->prop_double = that->prop_double;
+ else if ( this->types & mlt_prop_position )
+ this->prop_position = that->prop_position;
+ else if ( this->types & mlt_prop_string )
+ {
+ if ( that->prop_string != NULL )
+ this->prop_string = strdup( that->prop_string );
+ }
+ else if ( this->types & mlt_prop_data && this->serialiser != NULL )
+ {
+ this->types = mlt_prop_string;
+ this->prop_string = this->serialiser( this->data, this->length );
+ }
+}
extern void *mlt_property_get_data( mlt_property self, int *length );
extern void mlt_property_close( mlt_property self );
+extern void mlt_property_pass( mlt_property this, mlt_property that );
+
#endif