MLT  7.24.0
mlt_properties.h
Go to the documentation of this file.
1 
23 #ifndef MLT_PROPERTIES_H
24 #define MLT_PROPERTIES_H
25 
26 #include "mlt_events.h"
27 #include "mlt_types.h"
28 #include <stdio.h>
29 
40 {
41  void *child;
42  void *local;
46  void *close_object;
47 };
48 
49 extern int mlt_properties_init(mlt_properties, void *child);
51 extern int mlt_properties_set_lcnumeric(mlt_properties, const char *locale);
53 extern mlt_properties mlt_properties_load(const char *file);
54 extern int mlt_properties_preset(mlt_properties self, const char *name);
60 extern int mlt_properties_copy(mlt_properties self, mlt_properties that, const char *prefix);
61 extern int mlt_properties_pass(mlt_properties self, mlt_properties that, const char *prefix);
62 extern void mlt_properties_pass_property(mlt_properties self, mlt_properties that, const char *name);
63 extern int mlt_properties_pass_list(mlt_properties self, mlt_properties that, const char *list);
64 extern int mlt_properties_set(mlt_properties self, const char *name, const char *value);
66  const char *name,
67  const char *value,
68  const char *def);
69 extern int mlt_properties_set_string(mlt_properties self, const char *name, const char *value);
70 extern int mlt_properties_parse(mlt_properties self, const char *namevalue);
71 extern char *mlt_properties_get(mlt_properties self, const char *name);
72 extern char *mlt_properties_get_name(mlt_properties self, int index);
74 extern char *mlt_properties_get_value(mlt_properties self, int index);
75 extern void *mlt_properties_get_data_at(mlt_properties self, int index, int *size);
76 extern int mlt_properties_get_int(mlt_properties self, const char *name);
77 extern int mlt_properties_set_int(mlt_properties self, const char *name, int value);
78 extern int64_t mlt_properties_get_int64(mlt_properties self, const char *name);
79 extern int mlt_properties_set_int64(mlt_properties self, const char *name, int64_t value);
80 extern double mlt_properties_get_double(mlt_properties self, const char *name);
81 extern int mlt_properties_set_double(mlt_properties self, const char *name, double value);
83 extern int mlt_properties_set_position(mlt_properties self, const char *name, mlt_position value);
85  mlt_properties self, const char *name, void *value, int length, mlt_destructor, mlt_serialiser);
86 extern void *mlt_properties_get_data(mlt_properties self, const char *name, int *length);
87 extern int mlt_properties_rename(mlt_properties self, const char *source, const char *dest);
89 extern void mlt_properties_dump(mlt_properties self, FILE *output);
90 extern void mlt_properties_debug(mlt_properties self, const char *title, FILE *output);
91 extern int mlt_properties_save(mlt_properties, const char *);
92 extern int mlt_properties_dir_list(mlt_properties, const char *, const char *, int);
95 extern mlt_properties mlt_properties_parse_yaml(const char *file);
99 extern void mlt_properties_clear(mlt_properties self, const char *name);
100 extern int mlt_properties_exists(mlt_properties self, const char *name);
101 
102 extern char *mlt_properties_get_time(mlt_properties, const char *name, mlt_time_format);
105 
106 extern int mlt_properties_set_color(mlt_properties, const char *name, mlt_color value);
109  const char *name,
110  mlt_color value,
111  int position,
112  int length,
113  mlt_keyframe_type keyframe_type);
115  const char *name,
116  int position,
117  int length);
118 
120  const char *name,
121  int position,
122  int length);
124  mlt_properties self, const char *name, const char *value, int position, int length);
126  const char *name,
127  int position,
128  int length);
130  const char *name,
131  int value,
132  int position,
133  int length,
134  mlt_keyframe_type keyframe_type);
136  const char *name,
137  int position,
138  int length);
140  const char *name,
141  double value,
142  int position,
143  int length,
144  mlt_keyframe_type keyframe_type);
146 extern int mlt_properties_is_anim(mlt_properties self, const char *name);
147 
148 extern int mlt_properties_set_rect(mlt_properties self, const char *name, mlt_rect value);
149 extern mlt_rect mlt_properties_get_rect(mlt_properties self, const char *name);
151  const char *name,
152  mlt_rect value,
153  int position,
154  int length,
155  mlt_keyframe_type keyframe_type);
157  const char *name,
158  int position,
159  int length);
160 
162  const char *name_from,
163  const char *name_to);
165  const char *name_from,
166  const char *name_to);
167 
169  const char *name,
170  mlt_properties properties);
173 
174 #endif
event handling
int mlt_properties_to_utf8(mlt_properties properties, const char *name_from, const char *name_to)
Provides forward definitions of all public types.
char *(* mlt_serialiser)(void *, int length)
pointer to serialization function
Definition: mlt_types.h:270
mlt_time_format
The time string formats.
Definition: mlt_types.h:134
int32_t mlt_position
Definition: mlt_types.h:217
void(* mlt_destructor)(void *)
pointer to destructor function
Definition: mlt_types.h:269
mlt_keyframe_type
Interpolation methods for animation keyframes.
Definition: mlt_types.h:143
Property Animation class.
Definition: mlt_animation.c:51
A tuple of color components.
Definition: mlt_types.h:234
Properties class.
Definition: mlt_properties.h:40
int mlt_properties_set_int64(mlt_properties self, const char *name, int64_t value)
Set a property to a 64-bit integer value.
Definition: mlt_properties.c:1091
int mlt_properties_set(mlt_properties self, const char *name, const char *value)
Set a property to a string.
Definition: mlt_properties.c:727
void mlt_properties_pass_property(mlt_properties self, mlt_properties that, const char *name)
Copy a property to another properties list.
Definition: mlt_properties.c:634
mlt_properties mlt_properties_new()
Create a properties object.
Definition: mlt_properties.c:119
int mlt_properties_set_double(mlt_properties self, const char *name, double value)
Set a property to a floating point value.
Definition: mlt_properties.c:1142
int mlt_properties_set_int(mlt_properties self, const char *name, int value)
Set a property to an integer value.
Definition: mlt_properties.c:1047
int mlt_properties_init(mlt_properties self, void *child)
Initialize a properties object that was already allocated.
Definition: mlt_properties.c:84
void * child
the object of a subclass
Definition: mlt_properties.h:41
int mlt_properties_set_color(mlt_properties self, const char *name, mlt_color color)
Set a property to an integer value by color.
Definition: mlt_properties.c:2308
void mlt_properties_debug(mlt_properties self, const char *title, FILE *output)
Output the properties to a file handle.
Definition: mlt_properties.c:1325
int mlt_properties_anim_set_double(mlt_properties self, const char *name, double value, int position, int length, mlt_keyframe_type keyframe_type)
Set a property to a real number at a frame position.
Definition: mlt_properties.c:2601
int mlt_properties_set_data(mlt_properties self, const char *name, void *value, int length, mlt_destructor destroy, mlt_serialiser serialise)
Store binary data as a property.
Definition: mlt_properties.c:1242
void * close_object
the object supplied to the close virtual function
Definition: mlt_properties.h:46
char * mlt_properties_serialise_yaml(mlt_properties self)
Serialize a properties list as a string of YAML Tiny.
Definition: mlt_properties.c:2162
int mlt_properties_inherit(mlt_properties self, mlt_properties that)
Copy all serializable properties to another properties list.
Definition: mlt_properties.c:433
mlt_color mlt_properties_anim_get_color(mlt_properties self, const char *name, int position, int length)
Get a color associated to the name at a frame position.
Definition: mlt_properties.c:2412
mlt_color mlt_properties_get_color(mlt_properties self, const char *name)
Convert a numeric property to a tuple of color components.
Definition: mlt_properties.c:2340
mlt_rect mlt_properties_anim_get_rect(mlt_properties self, const char *name, int position, int length)
Get a rectangle associated to the name at a frame position.
Definition: mlt_properties.c:2755
void * local
instance object
Definition: mlt_properties.h:42
int mlt_properties_anim_set_color(mlt_properties self, const char *name, mlt_color value, int position, int length, mlt_keyframe_type keyframe_type)
Set a property to an integer value by color at a frame position.
Definition: mlt_properties.c:2366
mlt_animation mlt_properties_get_animation(mlt_properties self, const char *name)
Get the animation associated to the name.
Definition: mlt_properties.c:2644
int mlt_properties_preset(mlt_properties self, const char *name)
Set properties from a preset.
Definition: mlt_properties.c:282
int mlt_properties_set_or_default(mlt_properties self, const char *name, const char *value, const char *def)
Set or default a property to a string.
Definition: mlt_properties.c:818
int64_t mlt_properties_get_int64(mlt_properties self, const char *name)
Get a 64-bit integer associated to the name.
Definition: mlt_properties.c:1076
int mlt_properties_pass_list(mlt_properties self, mlt_properties that, const char *list)
Copy all properties specified in a comma-separated list to another properties list.
Definition: mlt_properties.c:656
char * mlt_properties_get_value_tf(mlt_properties self, int index, mlt_time_format time_format)
Get a property's string value by index (with time format).
Definition: mlt_properties.c:918
int mlt_properties_pass(mlt_properties self, mlt_properties that, const char *prefix)
Pass all serializable properties that match a prefix to another properties object.
Definition: mlt_properties.c:508
int mlt_properties_rename(mlt_properties self, const char *source, const char *dest)
Rename a property.
Definition: mlt_properties.c:1275
char * mlt_properties_anim_get(mlt_properties self, const char *name, int position, int length)
Get a string value by name at a frame position.
Definition: mlt_properties.c:2445
int mlt_properties_set_lcnumeric(mlt_properties self, const char *locale)
Set the numeric locale used for string/double conversions.
Definition: mlt_properties.c:139
mlt_properties mlt_properties_load(const char *filename)
Create a properties object by reading a .properties text file.
Definition: mlt_properties.c:251
char * mlt_properties_get_value(mlt_properties self, int index)
Get a property's string value by index.
Definition: mlt_properties.c:937
int mlt_properties_from_utf8(mlt_properties properties, const char *name_from, const char *name_to)
Convert UTF-8 property to the locale-defined encoding.
Definition: mlt_properties.c:2784
void mlt_properties_mirror(mlt_properties self, mlt_properties that)
Set a properties list to be a mirror copy of another.
Definition: mlt_properties.c:417
int mlt_properties_anim_set_int(mlt_properties self, const char *name, int value, int position, int length, mlt_keyframe_type keyframe_type)
Set a property to an integer value at a frame position.
Definition: mlt_properties.c:2529
void mlt_properties_clear(mlt_properties self, const char *name)
Remove the value for a property.
Definition: mlt_properties.c:2211
int mlt_properties_is_sequence(mlt_properties properties)
Determine if the properties list is really just a sequence or ordered list.
Definition: mlt_properties.c:1541
void mlt_properties_dump(mlt_properties self, FILE *output)
Dump the properties to a file handle.
Definition: mlt_properties.c:1306
int mlt_properties_set_position(mlt_properties self, const char *name, mlt_position value)
Set a property to a position value.
Definition: mlt_properties.c:1193
const char * mlt_properties_get_lcnumeric(mlt_properties self)
Get the numeric locale for this properties object.
Definition: mlt_properties.c:171
int mlt_properties_parse(mlt_properties self, const char *namevalue)
Set a value by parsing a name=value string.
Definition: mlt_properties.c:985
void mlt_properties_close(mlt_properties self)
Close a properties object.
Definition: mlt_properties.c:1480
double mlt_properties_get_double(mlt_properties self, const char *name)
Get a floating point value associated to the name.
Definition: mlt_properties.c:1120
char * mlt_properties_get_name(mlt_properties self, int index)
Get a property name by index.
Definition: mlt_properties.c:898
mlt_rect mlt_properties_get_rect(mlt_properties self, const char *name)
Get a rectangle associated to the name.
Definition: mlt_properties.c:2688
int mlt_properties_copy(mlt_properties self, mlt_properties that, const char *prefix)
Copy all serializable properties that match a prefix to another properties object.
Definition: mlt_properties.c:478
int mlt_properties_anim_get_int(mlt_properties self, const char *name, int position, int length)
Get an integer associated to the name at a frame position.
Definition: mlt_properties.c:2506
mlt_properties mlt_properties_get_properties_at(mlt_properties self, int index)
Get a nested properties object by index.
Definition: mlt_properties.c:2848
double mlt_properties_anim_get_double(mlt_properties self, const char *name, int position, int length)
Get a real number associated to the name at a frame position.
Definition: mlt_properties.c:2575
int mlt_properties_dec_ref(mlt_properties self)
Decrement the reference count.
Definition: mlt_properties.c:380
int mlt_properties_exists(mlt_properties self, const char *name)
Check if a property exists.
Definition: mlt_properties.c:2240
mlt_position mlt_properties_get_position(mlt_properties self, const char *name)
Get a position value associated to the name.
Definition: mlt_properties.c:1171
int mlt_properties_save(mlt_properties self, const char *filename)
Save the properties to a file by name.
Definition: mlt_properties.c:1363
void * mlt_properties_get_data_at(mlt_properties self, int index, int *size)
Get a data value by index.
Definition: mlt_properties.c:952
mlt_position mlt_properties_time_to_frames(mlt_properties self, const char *time)
Convert a time string to a frame count.
Definition: mlt_properties.c:2292
int mlt_properties_inc_ref(mlt_properties self)
Increment the reference count.
Definition: mlt_properties.c:361
void * mlt_properties_get_data(mlt_properties self, const char *name, int *length)
Get a binary data value associated to the name.
Definition: mlt_properties.c:1224
mlt_destructor close
the destructor virtual function
Definition: mlt_properties.h:45
char * mlt_properties_frames_to_time(mlt_properties self, mlt_position frames, mlt_time_format format)
Convert a frame count to a time string.
Definition: mlt_properties.c:2277
int mlt_properties_count(mlt_properties self)
Return the number of items in the list.
Definition: mlt_properties.c:969
int mlt_properties_anim_set(mlt_properties self, const char *name, const char *value, int position, int length)
Set a property to a string at a frame position.
Definition: mlt_properties.c:2470
int mlt_properties_set_properties(mlt_properties self, const char *name, mlt_properties properties)
Set a property to a nested properties object.
Definition: mlt_properties.c:2805
void mlt_properties_lock(mlt_properties self)
Protect a properties list against concurrent access.
Definition: mlt_properties.c:2184
char * mlt_properties_get_time(mlt_properties self, const char *name, mlt_time_format format)
Get a time string associated to the name.
Definition: mlt_properties.c:2255
int mlt_properties_anim_set_rect(mlt_properties self, const char *name, mlt_rect value, int position, int length, mlt_keyframe_type keyframe_type)
Set a property to a rectangle value at a frame position.
Definition: mlt_properties.c:2709
int mlt_properties_get_int(mlt_properties self, const char *name)
Get an integer associated to the name.
Definition: mlt_properties.c:1025
void mlt_properties_unlock(mlt_properties self)
End protecting a properties list against concurrent access.
Definition: mlt_properties.c:2196
mlt_properties mlt_properties_get_properties(mlt_properties self, const char *name)
Get a nested properties object by name.
Definition: mlt_properties.c:2834
int mlt_properties_is_anim(mlt_properties self, const char *name)
Check if a property is animated.
Definition: mlt_properties.c:2866
int mlt_properties_ref_count(mlt_properties self)
Get the reference count.
Definition: mlt_properties.c:399
int mlt_properties_set_rect(mlt_properties self, const char *name, mlt_rect value)
Set a property to a rectangle value.
Definition: mlt_properties.c:2659
mlt_properties mlt_properties_parse_yaml(const char *filename)
Parse a YAML Tiny file by name.
Definition: mlt_properties.c:1858
int mlt_properties_set_string(mlt_properties self, const char *name, const char *value)
Set a property to a string.
Definition: mlt_properties.c:840
int mlt_properties_dir_list(mlt_properties self, const char *dirname, const char *pattern, int sort)
Get the contents of a directory.
Definition: mlt_properties.c:1442
char * mlt_properties_get(mlt_properties self, const char *name)
Get a string value by name.
Definition: mlt_properties.c:878
A rectangle type with coordinates, size, and opacity.
Definition: mlt_types.h:223