8b6a0e99ecc9e827c5d42069b77feb672a5a2c41
[melted] / 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_position = 4,
35 mlt_prop_double = 8,
36 mlt_prop_data = 16,
37 mlt_prop_int64 = 32
38 }
39 mlt_property_type;
40
41 /** Property structure.
42 */
43
44 typedef struct mlt_property_s
45 {
46 // Stores a bit pattern of types available for this property
47 mlt_property_type types;
48
49 // Atomic type handling
50 int prop_int;
51 mlt_position prop_position;
52 double prop_double;
53 int64_t prop_int64;
54
55 // String handling
56 char *prop_string;
57
58 // Generic type handling
59 void *data;
60 int length;
61 mlt_destructor destructor;
62 mlt_serialiser serialiser;
63 }
64 *mlt_property;
65
66 /** API
67 */
68
69 extern mlt_property mlt_property_init( );
70 extern int mlt_property_set_int( mlt_property self, int value );
71 extern int mlt_property_set_double( mlt_property self, double value );
72 extern int mlt_property_set_position( mlt_property self, mlt_position value );
73 extern int mlt_property_set_int64( mlt_property self, int64_t value );
74 extern int mlt_property_set_string( mlt_property self, const char *value );
75 extern int mlt_property_set_data( mlt_property self, void *value, int length, mlt_destructor destructor, mlt_serialiser serialiser );
76 extern int mlt_property_get_int( mlt_property self );
77 extern double mlt_property_get_double( mlt_property self );
78 extern mlt_position mlt_property_get_position( mlt_property self );
79 extern int64_t mlt_property_get_int64( mlt_property self );
80 extern char *mlt_property_get_string( mlt_property self );
81 extern void *mlt_property_get_data( mlt_property self, int *length );
82 extern void mlt_property_close( mlt_property self );
83
84 extern void mlt_property_pass( mlt_property this, mlt_property that );
85
86 #endif
87