X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fframework%2Fmlt_properties.c;fp=src%2Fframework%2Fmlt_properties.c;h=18452dde08308623d114edab5fd1515e660ffc97;hb=77a0ee9bfb58af4e52cde4bc648e81be1b48c2d4;hp=b42d02a4c90cd44f22dec0dea7eaf0d8088d9a25;hpb=54ad5dc2fa65c1cb17d63491037eae5ce9154d84;p=melted diff --git a/src/framework/mlt_properties.c b/src/framework/mlt_properties.c index b42d02a..18452dd 100644 --- a/src/framework/mlt_properties.c +++ b/src/framework/mlt_properties.c @@ -215,7 +215,7 @@ int mlt_properties_ref_count( mlt_properties this ) 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 ) @@ -264,6 +264,7 @@ int mlt_properties_pass( mlt_properties this, mlt_properties that, const char *p return 0; } + /** Locate a property by name */ @@ -335,6 +336,52 @@ static mlt_property mlt_properties_fetch( mlt_properties this, const char *name return property; } +/** Pass property 'name' from 'that' to 'this' +* Who to blame: Zach +*/ + +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 +*/ + +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. */