8fb209c464dd423138912f2656743b96a28edf33
[melted] / mlt / src / framework / mlt_property.h
1 /*
2 * mlt_property.h -- property class
3 * Copyright (C) 2003-2004 Ushodaya Enterprises Limited
4 * Author: Charles Yates <charles.yates@pandora.be>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21 #ifndef _MLT_PROPERTY_H_
22 #define _MLT_PROPERTY_H_
23
24 #include "mlt_types.h"
25
26 /** Bit pattern for properties.
27 */
28
29 typedef enum
30 {
31 mlt_prop_none = 0,
32 mlt_prop_int = 1,
33 mlt_prop_string = 2,
34 mlt_prop_timecode = 4,
35 mlt_prop_double = 8,
36 mlt_prop_data = 16
37 }
38 mlt_property_type;
39
40 /** Property structure.
41 */
42
43 typedef struct mlt_property_s
44 {
45 // Stores a bit pattern of types available for this property
46 mlt_property_type types;
47
48 // Atomic type handling
49 int prop_int;
50 mlt_timecode prop_timecode;
51 double prop_double;
52
53 // String handling
54 char *prop_string;
55
56 // Generic type handling
57 void *data;
58 int length;
59 mlt_destructor destructor;
60 mlt_serialiser serialiser;
61 }
62 *mlt_property;
63
64 /** API
65 */
66
67 extern mlt_property mlt_property_init( );
68 extern void mlt_property_clear( mlt_property this );
69 extern int mlt_property_set_int( mlt_property this, int value );
70 extern int mlt_property_set_double( mlt_property this, double value );
71 extern int mlt_property_set_timecode( mlt_property this, mlt_timecode value );
72 extern int mlt_property_set_string( mlt_property this, char *value );
73 extern int mlt_property_set_data( mlt_property this, void *value, int length, mlt_destructor destructor, mlt_serialiser serialiser );
74 extern int mlt_property_get_int( mlt_property this );
75 extern double mlt_property_get_double( mlt_property this );
76 extern mlt_timecode mlt_property_get_timecode( mlt_property this );
77 extern char *mlt_property_get_string( mlt_property this );
78 extern void *mlt_property_get_data( mlt_property this, int *length );
79 extern void mlt_property_close( mlt_property this );
80
81 #endif
82