MLT  7.28.0
Public Member Functions | Data Fields | Private Member Functions | Private Attributes
mlt_properties_s Struct Reference

Properties class. More...

#include <mlt_properties.h>

Inheritance diagram for mlt_properties_s:
mlt_frame_s mlt_parser_s mlt_repository_s mlt_service_s mlt_consumer_s mlt_filter_s mlt_producer_s mlt_transition_s mlt_chain_s mlt_link_s mlt_multitrack_s mlt_playlist_s mlt_tractor_s

Public Member Functions

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
void mlt_properties_clear (mlt_properties self, const char *name)
 Remove the value for a property. More...
 
void mlt_properties_close (mlt_properties self)
 Close a properties object. More...
 
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. More...
 
int mlt_properties_count (mlt_properties self)
 Return the number of items in the list. More...
 
void mlt_properties_debug (mlt_properties self, const char *title, FILE *output)
 Output the properties to a file handle. More...
 
int mlt_properties_dec_ref (mlt_properties self)
 Decrement the reference count. More...
 
int mlt_properties_dir_list (mlt_properties self, const char *dirname, const char *pattern, int sort)
 Get the contents of a directory. More...
 
void mlt_properties_dump (mlt_properties self, FILE *output)
 Dump the properties to a file handle. More...
 
int mlt_properties_exists (mlt_properties self, const char *name)
 Check if a property exists. More...
 
char * mlt_properties_frames_to_time (mlt_properties self, mlt_position frames, mlt_time_format format)
 Convert a frame count to a time string. More...
 
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. More...
 
char * mlt_properties_get (mlt_properties self, const char *name)
 Get a string value by name. More...
 
mlt_animation mlt_properties_get_animation (mlt_properties self, const char *name)
 Get the animation associated to the name. More...
 
mlt_color mlt_properties_get_color (mlt_properties self, const char *name)
 Convert a numeric property to a tuple of color components. More...
 
void * mlt_properties_get_data (mlt_properties self, const char *name, int *length)
 Get a binary data value associated to the name. More...
 
void * mlt_properties_get_data_at (mlt_properties self, int index, int *size)
 Get a data value by index. More...
 
double mlt_properties_get_double (mlt_properties self, const char *name)
 Get a floating point value associated to the name. More...
 
int mlt_properties_get_int (mlt_properties self, const char *name)
 Get an integer associated to the name. More...
 
int64_t mlt_properties_get_int64 (mlt_properties self, const char *name)
 Get a 64-bit integer associated to the name. More...
 
const char * mlt_properties_get_lcnumeric (mlt_properties self)
 Get the numeric locale for this properties object. More...
 
char * mlt_properties_get_name (mlt_properties self, int index)
 Get a property name by index. More...
 
mlt_position mlt_properties_get_position (mlt_properties self, const char *name)
 Get a position value associated to the name. More...
 
mlt_properties mlt_properties_get_properties (mlt_properties self, const char *name)
 Get a nested properties object by name. More...
 
mlt_properties mlt_properties_get_properties_at (mlt_properties self, int index)
 Get a nested properties object by index. More...
 
mlt_rect mlt_properties_get_rect (mlt_properties self, const char *name)
 Get a rectangle associated to the name. More...
 
char * mlt_properties_get_time (mlt_properties self, const char *name, mlt_time_format format)
 Get a time string associated to the name. More...
 
char * mlt_properties_get_value (mlt_properties self, int index)
 Get a property's string value by index. More...
 
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). More...
 
int mlt_properties_inc_ref (mlt_properties self)
 Increment the reference count. More...
 
int mlt_properties_inherit (mlt_properties self, mlt_properties that)
 Copy all serializable properties to another properties list. More...
 
int mlt_properties_init (mlt_properties self, void *child)
 Initialize a properties object that was already allocated. More...
 
int mlt_properties_is_anim (mlt_properties self, const char *name)
 Check if a property is animated. More...
 
int mlt_properties_is_sequence (mlt_properties properties)
 Determine if the properties list is really just a sequence or ordered list. More...
 
mlt_properties mlt_properties_load (const char *filename)
 Create a properties object by reading a .properties text file. More...
 
void mlt_properties_lock (mlt_properties self)
 Protect a properties list against concurrent access. More...
 
void mlt_properties_mirror (mlt_properties self, mlt_properties that)
 Set a properties list to be a mirror copy of another. More...
 
mlt_properties mlt_properties_new ()
 Create a properties object. More...
 
int mlt_properties_parse (mlt_properties self, const char *namevalue)
 Set a value by parsing a name=value string. More...
 
mlt_properties mlt_properties_parse_yaml (const char *filename)
 Parse a YAML Tiny file by name. More...
 
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. More...
 
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. More...
 
void mlt_properties_pass_property (mlt_properties self, mlt_properties that, const char *name)
 Copy a property to another properties list. More...
 
int mlt_properties_preset (mlt_properties self, const char *name)
 Set properties from a preset. More...
 
int mlt_properties_ref_count (mlt_properties self)
 Get the reference count. More...
 
int mlt_properties_rename (mlt_properties self, const char *source, const char *dest)
 Rename a property. More...
 
int mlt_properties_save (mlt_properties self, const char *filename)
 Save the properties to a file by name. More...
 
char * mlt_properties_serialise_yaml (mlt_properties self)
 Serialize a properties list as a string of YAML Tiny. More...
 
int mlt_properties_set (mlt_properties self, const char *name, const char *value)
 Set a property to a string. More...
 
int mlt_properties_set_color (mlt_properties self, const char *name, mlt_color color)
 Set a property to an integer value by color. More...
 
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. More...
 
int mlt_properties_set_double (mlt_properties self, const char *name, double value)
 Set a property to a floating point value. More...
 
int mlt_properties_set_int (mlt_properties self, const char *name, int value)
 Set a property to an integer value. More...
 
int mlt_properties_set_int64 (mlt_properties self, const char *name, int64_t value)
 Set a property to a 64-bit integer value. More...
 
int mlt_properties_set_lcnumeric (mlt_properties self, const char *locale)
 Set the numeric locale used for string/double conversions. More...
 
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. More...
 
int mlt_properties_set_position (mlt_properties self, const char *name, mlt_position value)
 Set a property to a position value. More...
 
int mlt_properties_set_properties (mlt_properties self, const char *name, mlt_properties properties)
 Set a property to a nested properties object. More...
 
int mlt_properties_set_rect (mlt_properties self, const char *name, mlt_rect value)
 Set a property to a rectangle value. More...
 
int mlt_properties_set_string (mlt_properties self, const char *name, const char *value)
 Set a property to a string. More...
 
mlt_position mlt_properties_time_to_frames (mlt_properties self, const char *time)
 Convert a time string to a frame count. More...
 
void mlt_properties_unlock (mlt_properties self)
 End protecting a properties list against concurrent access. More...
 

Data Fields

mlt_destructor close
 the destructor virtual function More...
 
void * close_object
 the object supplied to the close virtual function More...
 

Private Member Functions

static int generate_hash (const char *name)
 Generate a hash key. More...
 
static int mlt_compare (const void *self, const void *that)
 Compare the string or serialized value of two properties. More...
 
static int mlt_fnmatch (const char *wild, const char *file)
 Test whether a filename or pathname matches a shell-style pattern. More...
 
static mlt_property mlt_properties_add (mlt_properties self, const char *name)
 Add a new property. More...
 
static void mlt_properties_do_mirror (mlt_properties self, const char *name)
 Copy a serializable property to a properties list that is mirroring this one. More...
 
static mlt_property mlt_properties_fetch (mlt_properties self, const char *name)
 Fetch a property by name and add one if not found. More...
 
static mlt_property mlt_properties_find (mlt_properties self, const char *name)
 Locate a property by name. More...
 
static void serialise_yaml (mlt_properties self, strbuf output, int indent, int is_parent_sequence)
 Recursively serialize a properties list into a string buffer as YAML Tiny. More...
 

Private Attributes

void * child
 the object of a subclass More...
 
void * local
 instance object More...
 

Detailed Description

Properties class.

Properties is a combination list/dictionary of name/mlt_property pairs. It is also a base class for many of the other MLT classes.

Event:
property-changed a property's value changed; the event data is a string for the name of the property

Member Function Documentation

◆ generate_hash()

static int generate_hash ( const char *  name)
inlineprivate

Generate a hash key.

Parameters
namea string
Returns
an integer

◆ mlt_compare()

static int mlt_compare ( const void *  self,
const void *  that 
)
private

Compare the string or serialized value of two properties.

Parameters
selfa property
thata property
Returns
< 0 if self less than that, 0 if equal, or > 0 if self is greater than that

◆ mlt_fnmatch()

static int mlt_fnmatch ( const char *  wild,
const char *  file 
)
private

Test whether a filename or pathname matches a shell-style pattern.

Parameters
wilda string containing a wildcard pattern
filethe name of a file to test against
Returns
true if the file name matches the wildcard pattern

◆ mlt_properties_add()

static mlt_property mlt_properties_add ( mlt_properties  self,
const char *  name 
)
private

Add a new property.

Parameters
selfa properties list
namethe name of the new property
Returns
the new property

◆ mlt_properties_anim_get()

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.

Do not free the returned string. It's lifetime is controlled by the property and this properties object. Enclose a string property value in double quotation marks to prevent mlt_properties_anim_get() from interpreting the string as animation. The double-quotes are removed when retrieved through mlt_properties_anim_get(). The same rule applies to string keyframe values: to protect a keyframed-string value containing a semicolon or equal sign, enclose it in double-quotes.

Parameters
selfa properties list
namethe property to get
positionthe frame number
lengththe maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that
Returns
the property's string value or NULL if it does not exist

◆ mlt_properties_anim_get_color()

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.

Parameters
selfa properties list
namethe property to get
positionthe frame number
lengththe maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that
Returns
a color structure

◆ mlt_properties_anim_get_double()

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.

Parameters
selfa properties list
namethe property to get
positionthe frame number
lengththe maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that
Returns
the real number, 0 if not found (which may also be a legitimate value)

◆ mlt_properties_anim_get_int()

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.

Parameters
selfa properties list
namethe property to get
positionthe frame number
lengththe maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that
Returns
the integer value, 0 if not found (which may also be a legitimate value)

◆ mlt_properties_anim_get_rect()

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.

Parameters
selfa properties list
namethe property to get
positionthe frame number
lengththe maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that
Returns
the rectangle value, the rectangle fields will be DBL_MIN if not found

◆ mlt_properties_anim_set()

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.

The event "property-changed" is fired after the property has been set.

This makes a copy of the string value you supply.

Parameters
selfa properties list
namethe property to set
valuethe property's new value
positionthe frame number
lengththe maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that
Returns
true if error

◆ mlt_properties_anim_set_color()

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.

Parameters
selfa properties list
namethe property to set
valuethe color
positionthe frame number
lengththe maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that
keyframe_typethe interpolation method for this keyframe
Returns
true if error

◆ mlt_properties_anim_set_double()

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.

Parameters
selfa properties list
namethe property to set
valuethe real number
positionthe frame number
lengththe maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that
keyframe_typethe interpolation method for this keyframe
Returns
true if error

◆ mlt_properties_anim_set_int()

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.

Parameters
selfa properties list
namethe property to set
valuethe integer
positionthe frame number
lengththe maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that
keyframe_typethe interpolation method for this keyframe
Returns
true if error

◆ mlt_properties_anim_set_rect()

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.

Parameters
selfa properties list
namethe property to set
valuethe rectangle
positionthe frame number
lengththe maximum number of frames when interpreting negative keyframe times, <=0 if you don't care or need that
keyframe_typethe interpolation method for this keyframe
Returns
true if error

◆ mlt_properties_clear()

void mlt_properties_clear ( mlt_properties  self,
const char *  name 
)

Remove the value for a property.

This initializes the value to zero and removes any string, data, or animation. This is especially useful when you want to reset an animation.

Parameters
selfa properties list
namethe name of the property to clear

◆ mlt_properties_close()

void mlt_properties_close ( mlt_properties  self)

Close a properties object.

Deallocates the properties object and everything it contains.

Parameters
selfa properties object

◆ mlt_properties_copy()

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.

Parameters
selfthe properties to copy to
thatThe properties to copy from
prefixthe property names to match (required)
Returns
true if error

◆ mlt_properties_count()

int mlt_properties_count ( mlt_properties  self)

Return the number of items in the list.

Parameters
selfa properties list
Returns
the number of property objects or -1 if error

◆ mlt_properties_debug()

void mlt_properties_debug ( mlt_properties  self,
const char *  title,
FILE *  output 
)

Output the properties to a file handle.

This version includes reference counts and does not put each property on a new line.

Parameters
selfa properties pointer
titlea string to preface the output
outputa file handle

◆ mlt_properties_dec_ref()

int mlt_properties_dec_ref ( mlt_properties  self)

Decrement the reference count.

Parameters
selfa properties list
Returns
the new reference count

◆ mlt_properties_dir_list()

int mlt_properties_dir_list ( mlt_properties  self,
const char *  dirname,
const char *  pattern,
int  sort 
)

Get the contents of a directory.

Obtains an optionally sorted list of the files found in a directory with a specific wild card. Entries in the list have a numeric name (running from 0 to count - 1). Only values change position if sort is enabled. Designed to be posix compatible (linux, os/x, mingw etc).

Parameters
selfa properties list
dirnamethe name of the directory
patterna wildcard pattern to filter the directory listing
sortDo you want to sort the directory listing?
Returns
the number of items in the directory listing

◆ mlt_properties_do_mirror()

static void mlt_properties_do_mirror ( mlt_properties  self,
const char *  name 
)
inlineprivate

Copy a serializable property to a properties list that is mirroring this one.

Special case - when a container (such as loader) is protecting another producer, we need to ensure that properties are passed through to the real producer.

Parameters
selfa properties list
namethe name of the property to copy

◆ mlt_properties_dump()

void mlt_properties_dump ( mlt_properties  self,
FILE *  output 
)

Dump the properties to a file handle.

Parameters
selfa properties list
outputa file handle

◆ mlt_properties_exists()

int mlt_properties_exists ( mlt_properties  self,
const char *  name 
)

Check if a property exists.

This function is not a substitute for checking for NULL as a property could be set to NULL.

This function will return false immediately after a call to mlt_properties_clear() or if the property has never been created.

Parameters
selfa properties list
namethe name of the property to query
Returns
true if the property exists

◆ mlt_properties_fetch()

static mlt_property mlt_properties_fetch ( mlt_properties  self,
const char *  name 
)
private

Fetch a property by name and add one if not found.

Parameters
selfa properties list
namethe property to lookup or add
Returns
the property

◆ mlt_properties_find()

static mlt_property mlt_properties_find ( mlt_properties  self,
const char *  name 
)
inlineprivate

Locate a property by name.

Parameters
selfa properties list
namethe property to lookup by name
Returns
the property or NULL for failure

◆ mlt_properties_frames_to_time()

char * mlt_properties_frames_to_time ( mlt_properties  self,
mlt_position  frames,
mlt_time_format  format 
)

Convert a frame count to a time string.

Do not free the returned string. It's lifetime is controlled by the property.

Parameters
selfa properties list
framesthe frame count to convert
formatthe time format that you want
Returns
the time string or NULL if error, e.g. there is no profile

◆ mlt_properties_from_utf8()

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.

MLT uses UTF-8 for strings, but Windows cannot accept UTF-8 for a filename. Windows uses code pages for the locale encoding.

Parameters
selfa properties list
name_fromthe property to read whose value is a UTF-8 string
name_tothe name of the new property that will contain converted string
Returns
true if error

◆ mlt_properties_get()

char * mlt_properties_get ( mlt_properties  self,
const char *  name 
)

Get a string value by name.

Do not free the returned string. It's lifetime is controlled by the property and this properties object.

Parameters
selfa properties list
namethe property to get
Returns
the property's string value or NULL if it does not exist

◆ mlt_properties_get_animation()

mlt_animation mlt_properties_get_animation ( mlt_properties  self,
const char *  name 
)

Get the animation associated to the name.

Parameters
selfa properties list
namethe property to get
Returns
The animation object or NULL if the property has no animation

◆ mlt_properties_get_color()

mlt_color mlt_properties_get_color ( mlt_properties  self,
const char *  name 
)

Convert a numeric property to a tuple of color components.

If the property's string is red, green, blue, white, or black, then it is converted to the corresponding opaque color tuple. Otherwise, the property is fetched as an integer and then converted.

Parameters
selfa properties list
namethe property to get
Returns
a color structure

◆ mlt_properties_get_data()

void * mlt_properties_get_data ( mlt_properties  self,
const char *  name,
int *  length 
)

Get a binary data value associated to the name.

Do not free the returned pointer if you supplied a destructor function when you set this property.

Parameters
selfa properties list
namethe property to get
[out]lengthThe size of the binary data in bytes, if available (often it is not, you should know)

◆ mlt_properties_get_data_at()

void * mlt_properties_get_data_at ( mlt_properties  self,
int  index,
int *  size 
)

Get a data value by index.

Do not free the returned pointer if you supplied a destructor function when you set this property.

Parameters
selfa properties list
indexthe numeric index of the property
[out]sizethe size of the binary data in bytes or NULL if the index is out of range

◆ mlt_properties_get_double()

double mlt_properties_get_double ( mlt_properties  self,
const char *  name 
)

Get a floating point value associated to the name.

Parameters
selfa properties list
namethe property to get
Returns
the floating point, 0 if not found (which may also be a legitimate value)

◆ mlt_properties_get_int()

int mlt_properties_get_int ( mlt_properties  self,
const char *  name 
)

Get an integer associated to the name.

Parameters
selfa properties list
namethe property to get
Returns
The integer value, 0 if not found (which may also be a legitimate value)

◆ mlt_properties_get_int64()

int64_t mlt_properties_get_int64 ( mlt_properties  self,
const char *  name 
)

Get a 64-bit integer associated to the name.

Parameters
selfa properties list
namethe property to get
Returns
the integer value, 0 if not found (which may also be a legitimate value)

◆ mlt_properties_get_lcnumeric()

const char * mlt_properties_get_lcnumeric ( mlt_properties  self)

Get the numeric locale for this properties object.

Do not free the result.

Parameters
selfa properties list
Returns
the locale name if this properties has a specific locale it is using, NULL otherwise

◆ mlt_properties_get_name()

char * mlt_properties_get_name ( mlt_properties  self,
int  index 
)

Get a property name by index.

Do not free the returned string.

Parameters
selfa properties list
indexthe numeric index of the property
Returns
the name of the property or NULL if index is out of range

◆ mlt_properties_get_position()

mlt_position mlt_properties_get_position ( mlt_properties  self,
const char *  name 
)

Get a position value associated to the name.

Parameters
selfa properties list
namethe property to get
Returns
the position, 0 if not found (which may also be a legitimate value)

◆ mlt_properties_get_properties()

mlt_properties mlt_properties_get_properties ( mlt_properties  self,
const char *  name 
)

Get a nested properties object by name.

Parameters
selfa properties list
namethe property to get
Returns
the nested properties list

◆ mlt_properties_get_properties_at()

mlt_properties mlt_properties_get_properties_at ( mlt_properties  self,
int  index 
)

Get a nested properties object by index.

Parameters
selfa properties list
indexthe 0-based index value of the list item
Returns
the nested properties list

◆ mlt_properties_get_rect()

mlt_rect mlt_properties_get_rect ( mlt_properties  self,
const char *  name 
)

Get a rectangle associated to the name.

Parameters
selfa properties list
namethe property to get
Returns
the rectangle value, the rectangle fields will be DBL_MIN if not found

◆ mlt_properties_get_time()

char * mlt_properties_get_time ( mlt_properties  self,
const char *  name,
mlt_time_format  format 
)

Get a time string associated to the name.

Do not free the returned string. It's lifetime is controlled by the property.

Parameters
selfa properties list
namethe property to get
formatthe time format that you want
Returns
the property's time value or NULL if name does not exist or there is no profile

◆ mlt_properties_get_value()

char * mlt_properties_get_value ( mlt_properties  self,
int  index 
)

Get a property's string value by index.

Do not free the returned string.

Parameters
selfa properties list
indexthe numeric index of the property
Returns
the property value as a string or NULL if the index is out of range

◆ mlt_properties_get_value_tf()

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).

Do not free the returned string.

Parameters
selfa properties list
indexthe numeric index of the property
time_formatthe time format to use for animation
Returns
the property value as a string or NULL if the index is out of range

◆ mlt_properties_inc_ref()

int mlt_properties_inc_ref ( mlt_properties  self)

Increment the reference count.

Parameters
selfa properties list
Returns
the new reference count

◆ mlt_properties_inherit()

int mlt_properties_inherit ( mlt_properties  self,
mlt_properties  that 
)

Copy all serializable properties to another properties list.

Parameters
selfThe properties to copy to
thatThe properties to copy from
Returns
true if error

◆ mlt_properties_init()

int mlt_properties_init ( mlt_properties  self,
void *  child 
)

Initialize a properties object that was already allocated.

This does allocate its property_list, and it adds a reference count.

Parameters
selfthe properties structure to initialize
childan opaque pointer to a subclass object
Returns
true if failed

◆ mlt_properties_is_anim()

int mlt_properties_is_anim ( mlt_properties  self,
const char *  name 
)

Check if a property is animated.

Parameters
selfa properties list
namethe property to get
Returns
true if the property is animated

◆ mlt_properties_is_sequence()

int mlt_properties_is_sequence ( mlt_properties  properties)

Determine if the properties list is really just a sequence or ordered list.

Parameters
propertiesa properties list
Returns
true if all of the property names are numeric (a sequence)

◆ mlt_properties_load()

mlt_properties mlt_properties_load ( const char *  filename)

Create a properties object by reading a .properties text file.

Free the properties object with mlt_properties_close().

Deprecated:
Please start using mlt_properties_parse_yaml().
Parameters
filenamethe absolute file name
Returns
a new properties object

◆ mlt_properties_lock()

void mlt_properties_lock ( mlt_properties  self)

Protect a properties list against concurrent access.

Parameters
selfa properties list

◆ mlt_properties_mirror()

void mlt_properties_mirror ( mlt_properties  self,
mlt_properties  that 
)

Set a properties list to be a mirror copy of another.

Note that this does not copy all existing properties. Rather, you must call this before setting the properties that you wish to copy.

Parameters
thatthe properties which will receive copies of the properties as they are set.
selfthe properties to mirror

◆ mlt_properties_new()

mlt_properties mlt_properties_new ( )

Create a properties object.

This allocates the properties structure and calls mlt_properties_init() on it. Free the properties object with mlt_properties_close().

Returns
a new properties object

◆ mlt_properties_parse()

int mlt_properties_parse ( mlt_properties  self,
const char *  namevalue 
)

Set a value by parsing a name=value string.

Parameters
selfa properties list
namevaluea string containing name and value delimited by '='
Returns
true if there was an error

◆ mlt_properties_parse_yaml()

mlt_properties mlt_properties_parse_yaml ( const char *  filename)

Parse a YAML Tiny file by name.

Parameters
filenamethe name of a text file containing YAML Tiny
Returns
a new properties list

◆ mlt_properties_pass()

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.

Warning
The prefix is stripped from the name when it is set on the self properties list! For example a property named "foo.bar" will match prefix "foo.", but the property will be named simply "bar" on the receiving properties object.
Parameters
selfthe properties to copy to
thatThe properties to copy from
prefixthe property names to match (required)
Returns
true if error

◆ mlt_properties_pass_list()

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.

White space is also a delimiter.

Author
Zach zacha.nosp@m.ry.d.nosp@m.rew@g.nosp@m.mail.nosp@m..com
Parameters
selfthe properties to copy to
thatthe properties to copy from
lista delimited list of property names
Returns
true if error

◆ mlt_properties_pass_property()

void mlt_properties_pass_property ( mlt_properties  self,
mlt_properties  that,
const char *  name 
)

Copy a property to another properties list.

Author
Zach zacha.nosp@m.ry.d.nosp@m.rew@g.nosp@m.mail.nosp@m..com
Parameters
selfthe properties to copy to
thatthe properties to copy from
namethe name of the property to copy

◆ mlt_properties_preset()

int mlt_properties_preset ( mlt_properties  self,
const char *  name 
)

Set properties from a preset.

Presets are typically installed to $prefix/share/mlt/presets/{type}/{service}/[{profile}/]{name}. For example, "/usr/share/mlt/presets/consumer/avformat/dv_ntsc_wide/DVD" could be an encoding preset for a widescreen NTSC DVD Video. Do not specify the type and service in the preset name parameter; these are inferred automatically from the service to which you are applying the preset. Using the example above and assuming you are calling this function on the avformat consumer, the name passed to the function should simply be DVD. Note that the profile portion of the path is optional, but a profile-specific preset with the same name as a more generic one is given a higher priority.

Todo:
Look in a user-specific location - somewhere in the home directory.
Parameters
selfa properties list
namethe name of a preset in a well-known location or the explicit path
Returns
true if error

◆ mlt_properties_ref_count()

int mlt_properties_ref_count ( mlt_properties  self)

Get the reference count.

Parameters
selfa properties list
Returns
the current reference count

◆ mlt_properties_rename()

int mlt_properties_rename ( mlt_properties  self,
const char *  source,
const char *  dest 
)

Rename a property.

Parameters
selfa properties list
sourcethe property to rename
destthe new name
Returns
true if the name is already in use

◆ mlt_properties_save()

int mlt_properties_save ( mlt_properties  self,
const char *  filename 
)

Save the properties to a file by name.

This uses the dump format - one line per property.

Parameters
selfa properties list
filenamethe name of a file to create or overwrite
Returns
true if there was an error

◆ mlt_properties_serialise_yaml()

char * mlt_properties_serialise_yaml ( mlt_properties  self)

Serialize a properties list as a string of YAML Tiny.

The caller MUST free the returned string! This operates on properties containing properties as a hierarchical data structure.

Parameters
selfa properties list
Returns
a string containing YAML Tiny that represents the properties list

◆ mlt_properties_set()

int mlt_properties_set ( mlt_properties  self,
const char *  name,
const char *  value 
)

Set a property to a string.

The property name "properties" is reserved to load the preset in value. When the value begins with '@' then it is interpreted as a very simple math expression containing only the +, -, *, and / operators. The event "property-changed" is fired after the property has been set.

This makes a copy of the string value you supply.

Parameters
selfa properties list
namethe property to set
valuethe property's new value
Returns
true if error

◆ mlt_properties_set_color()

int mlt_properties_set_color ( mlt_properties  self,
const char *  name,
mlt_color  color 
)

Set a property to an integer value by color.

Parameters
selfa properties list
namethe property to set
colorthe color
Returns
true if error

◆ mlt_properties_set_data()

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.

Parameters
selfa properties list
namethe property to set
valuean opaque pointer to binary data
lengththe size of the binary data in bytes (optional)
destroya function to deallocate the binary data when the property is closed (optional)
serialisea function that can serialize the binary data as text (optional)
Returns
true if error

◆ mlt_properties_set_double()

int mlt_properties_set_double ( mlt_properties  self,
const char *  name,
double  value 
)

Set a property to a floating point value.

Parameters
selfa properties list
namethe property to set
valuethe floating point value
Returns
true if error

◆ mlt_properties_set_int()

int mlt_properties_set_int ( mlt_properties  self,
const char *  name,
int  value 
)

Set a property to an integer value.

Parameters
selfa properties list
namethe property to set
valuethe integer
Returns
true if error

◆ mlt_properties_set_int64()

int mlt_properties_set_int64 ( mlt_properties  self,
const char *  name,
int64_t  value 
)

Set a property to a 64-bit integer value.

Parameters
selfa properties list
namethe property to set
valuethe integer
Returns
true if error

◆ mlt_properties_set_lcnumeric()

int mlt_properties_set_lcnumeric ( mlt_properties  self,
const char *  locale 
)

Set the numeric locale used for string/double conversions.

Parameters
selfa properties list
localethe locale name
Returns
true if error

◆ mlt_properties_set_or_default()

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.

This makes a copy of the string value you supply.

Parameters
selfa properties list
namethe property to set
valuethe string value to set or NULL to use the default
defthe default string if value is NULL
Returns
true if error

◆ mlt_properties_set_position()

int mlt_properties_set_position ( mlt_properties  self,
const char *  name,
mlt_position  value 
)

Set a property to a position value.

Parameters
selfa properties list
namethe property to get
valuethe position
Returns
true if error

◆ mlt_properties_set_properties()

int mlt_properties_set_properties ( mlt_properties  self,
const char *  name,
mlt_properties  properties 
)

Set a property to a nested properties object.

Parameters
selfa properties list
namethe property to get
propertiesthe properties list to nest into self with name
Returns
true if error

◆ mlt_properties_set_rect()

int mlt_properties_set_rect ( mlt_properties  self,
const char *  name,
mlt_rect  value 
)

Set a property to a rectangle value.

Parameters
selfa properties list
namethe property to set
valuethe rectangle
Returns
true if error

◆ mlt_properties_set_string()

int mlt_properties_set_string ( mlt_properties  self,
const char *  name,
const char *  value 
)

Set a property to a string.

Unlike \mlt_properties_set this function does not attempt to interpret an expression. The property name "properties" is reserved to load the preset in value. The event "property-changed" is fired after the property has been set.

This makes a copy of the string value you supply.

Parameters
selfa properties list
namethe property to set
valuethe property's new value
Returns
true if error

◆ mlt_properties_time_to_frames()

mlt_position mlt_properties_time_to_frames ( mlt_properties  self,
const char *  time 
)

Convert a time string to a frame count.

Parameters
selfa properties list
timethe time string to convert
Returns
a frame count or a negative value if error, e.g. there is no profile

◆ mlt_properties_unlock()

void mlt_properties_unlock ( mlt_properties  self)

End protecting a properties list against concurrent access.

Parameters
selfa properties list

◆ serialise_yaml()

static void serialise_yaml ( mlt_properties  self,
strbuf  output,
int  indent,
int  is_parent_sequence 
)
private

Recursively serialize a properties list into a string buffer as YAML Tiny.

Parameters
selfa properties list
outputa string buffer to hold the serialized YAML Tiny
indentthe number of spaces to indent (for recursion, initialize to 0)
is_parent_sequenceIs this properties list really just a sequence (for recursion, initialize to 0)?

Field Documentation

◆ child

void* mlt_properties_s::child
private

the object of a subclass

◆ close

mlt_destructor mlt_properties_s::close

the destructor virtual function

◆ close_object

void* mlt_properties_s::close_object

the object supplied to the close virtual function

◆ local

void* mlt_properties_s::local
private

instance object


The documentation for this struct was generated from the following files: