]> git.sesse.net Git - mlt/blob - src/framework/mlt_animation.h
14560ab2d865c8188273674487d4cc8376cf0ab5
[mlt] / src / framework / mlt_animation.h
1 /*
2  * mlt_animation.h -- provides the property animation API
3  * Copyright (C) 2004-2013 Ushodaya Enterprises Limited
4  * Author: Charles Yates <charles.yates@pandora.be>
5  * Author: Dan Dennedy <dan@dennedy.org>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  */
21
22 #ifndef MLT_ANIMATION_H
23 #define MLT_ANIMATION_H
24
25 #include "mlt_types.h"
26 #include "mlt_property.h"
27
28 struct mlt_animation_item_s
29 {
30         int is_key; /**< = whether this is a key frame or an interpolated item */
31         int frame; /**< The actual frame this corresponds to */
32         mlt_property property;
33         mlt_keyframe_type keyframe_type;
34 };
35 typedef struct mlt_animation_item_s *mlt_animation_item; /**< pointer to an animation item */
36
37 struct mlt_animation_s;
38
39 /* Create a new animation object. */
40 extern mlt_animation mlt_animation_new( );
41 /* Parse the geometry specification for a given duration and range */
42 extern int mlt_animation_parse(mlt_animation self, const char *data, int length, double fps, locale_t locale );
43 /* Conditionally refresh the animation if it's modified */
44 extern int mlt_animation_refresh( mlt_animation self, const char *data, int length );
45 /* Get and set the length */
46 extern int mlt_animation_get_length( mlt_animation self );
47 extern void mlt_animation_set_length( mlt_animation self, int length );
48 /* Parse an item - doesn't affect the animation itself but uses current information for evaluation */
49 /* (item->frame should be specified if not included in the data itself) */
50 extern int mlt_animation_parse_item( mlt_animation self, mlt_animation_item item, const char *data );
51 /* Fetch an animation item for an absolute position */
52 extern int mlt_animation_get_item( mlt_animation self, mlt_animation_item item, int position );
53 /* Specify an animation item at an absolute position */
54 extern int mlt_animation_insert( mlt_animation self, mlt_animation_item item );
55 /* Remove the key at the specified position */
56 extern int mlt_animation_remove( mlt_animation self, int position );
57 /* Typically, re-interpolate after a series of insertions or removals. */
58 extern void mlt_animation_interpolate( mlt_animation self );
59 /* Get the key at the position or the next following */
60 extern int mlt_animation_next_key( mlt_animation self, mlt_animation_item item, int position );
61 extern int mlt_animation_prev_key( mlt_animation self, mlt_animation_item item, int position );
62 /* Serialize the current animation. */
63 extern char *mlt_animation_serialize_cut( mlt_animation self, int in, int out );
64 extern char *mlt_animation_serialize( mlt_animation self );
65 /* Close and destrory the animation. */
66 extern void mlt_animation_close( mlt_animation self );
67
68 #endif
69