]> git.sesse.net Git - mlt/commitdiff
Add mlt_properties_get_animation(); it might come in handy.
authorDan Dennedy <dan@dennedy.org>
Fri, 31 May 2013 02:44:20 +0000 (19:44 -0700)
committerDan Dennedy <dan@dennedy.org>
Fri, 31 May 2013 23:58:13 +0000 (16:58 -0700)
src/framework/mlt_animation.h
src/framework/mlt_properties.c
src/framework/mlt_properties.h
src/framework/mlt_property.c
src/framework/mlt_property.h
src/framework/mlt_types.h

index ef2deae18308299966f0516840d37f0a557f79d3..14560ab2d865c8188273674487d4cc8376cf0ab5 100644 (file)
@@ -32,10 +32,9 @@ struct mlt_animation_item_s
        mlt_property property;
        mlt_keyframe_type keyframe_type;
 };
-typedef struct mlt_animation_item_s *mlt_animation_item;
+typedef struct mlt_animation_item_s *mlt_animation_item; /**< pointer to an animation item */
 
 struct mlt_animation_s;
-typedef struct mlt_animation_s *mlt_animation;
 
 /* Create a new animation object. */
 extern mlt_animation mlt_animation_new( );
index c649137616a5e8305de0d83a373a531550c2ca84..0dfb4e605c1b5acff22b52528f8f16bd5168d571 100644 (file)
@@ -2400,3 +2400,17 @@ extern mlt_rect mlt_properties_anim_get_rect( mlt_properties self, const char *n
        mlt_rect rect = { DBL_MIN, DBL_MIN, DBL_MIN, DBL_MIN, DBL_MIN };
        return value == NULL ? rect : mlt_property_anim_get_rect( value, fps, list->locale, position, length );
 }
+
+/** Get the animation associated to the name.
+ *
+ * \public \memberof mlt_properties_s
+ * \param self a properties list
+ * \param name the property to get
+ * \return The animation object or NULL if the property has no animation
+ */
+
+mlt_animation mlt_properties_get_animation( mlt_properties self, const char *name )
+{
+       mlt_property value = mlt_properties_find( self, name );
+       return value == NULL ? NULL : mlt_property_get_animation( value );
+}
index f4b1b2acfb446170be1301af553922be91b669ce..547c9636ac3e58242dca696ba3a9eed42ee16703 100644 (file)
@@ -103,5 +103,6 @@ extern int mlt_properties_set_rect( mlt_properties self, const char *name, mlt_r
 extern mlt_rect mlt_properties_get_rect( mlt_properties self, const char *name );
 extern int mlt_properties_anim_set_rect( mlt_properties self, const char *name, mlt_rect value, int position, int length, mlt_keyframe_type keyframe_type );
 extern mlt_rect mlt_properties_anim_get_rect( mlt_properties self, const char *name, int position, int length );
+extern mlt_animation mlt_properties_get_animation( mlt_properties self, const char *name );
 
 #endif
index a165761133f3d6be46c7d4420f2fca814c70ba45..5a2ac5ca520866c7644ccd1e32f032e2c3830bdd 100644 (file)
@@ -1386,3 +1386,8 @@ mlt_rect mlt_property_anim_get_rect( mlt_property self, double fps, locale_t loc
        }
        return result;
 }
+
+mlt_animation mlt_property_get_animation( mlt_property self )
+{
+       return self->animation;
+}
index 1300c457f64331910037d162b787586fee9c6c2e..9bbccc064aaf1cc5755eca010c6ed210f9998f5e 100644 (file)
@@ -66,5 +66,6 @@ extern int mlt_property_set_rect( mlt_property self, mlt_rect value );
 extern mlt_rect mlt_property_get_rect( mlt_property self, locale_t locale );
 extern int mlt_property_anim_set_rect( mlt_property self, mlt_rect value, double fps, locale_t locale, int position, int length, mlt_keyframe_type keyframe_type );
 extern mlt_rect mlt_property_anim_get_rect( mlt_property self, double fps, locale_t locale, int position, int length );
+extern mlt_animation mlt_property_get_animation( mlt_property self );
 
 #endif
index bf1c1c476a8dfcdca9eab8118240df971c61670c..b25b2b96e43122d40a45d7723d75ff8501d27df5 100644 (file)
@@ -161,6 +161,7 @@ typedef struct mlt_profile_s *mlt_profile;              /**< pointer to Profile
 typedef struct mlt_repository_s *mlt_repository;        /**< pointer to Repository object */
 typedef struct mlt_cache_s *mlt_cache;                  /**< pointer to Cache object */
 typedef struct mlt_cache_item_s *mlt_cache_item;        /**< pointer to CacheItem object */
+typedef struct mlt_animation_s *mlt_animation;          /**< pointer to Property Animation object */
 
 typedef void ( *mlt_destructor )( void * );             /**< pointer to destructor function */
 typedef char *( *mlt_serialiser )( void *, int length );/**< pointer to serialization function */