Gst.Preset¶
- Implementations:
None
Methods¶
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
|
|
|
|
|
|
|
|
|
|
|
Properties¶
None
Signals¶
None
Fields¶
None
Class Details¶
- class Gst.Preset¶
- Bases:
- Structure:
This interface offers methods to query and manipulate parameter preset sets. A preset is a bunch of property settings, together with meta data and a name. The name of a preset serves as key for subsequent method calls to manipulate single presets. All instances of one type will share the list of presets. The list is created on demand, if presets are not used, the list is not created.
The interface comes with a default implementation that serves most plugins. Wrapper plugins will override most methods to implement support for the native preset format of those wrapped plugins. One method that is useful to be overridden is
Gst.Preset.get_property_names
(). With that one can control which properties are saved and in which order. When implementing support for read-only presets, one should set the vmethods forGst.Preset.save_preset
() andGst.Preset.delete_preset
() toNone
. Applications can useGst.Preset.is_editable
() to check for that.The default implementation supports presets located in a system directory, application specific directory and in the users home directory. When getting a list of presets individual presets are read and overlaid in 1) system, 2) application and 3) user order. Whenever an earlier entry is newer, the later entries will be updated. Since 1.8 you can also provide extra paths where to find presets through the GST_PRESET_PATH environment variable. Presets found in those paths will be considered as “app presets”.
- classmethod get_app_dir()[source]¶
-
Gets the directory for application specific presets if set by the application.
- classmethod set_app_dir(app_dir)[source]¶
- Parameters:
app_dir (
str
) – the application specific preset dir- Returns:
- Return type:
Sets an extra directory as an absolute path that should be considered when looking for presets. Any presets in the application dir will shadow the system presets.
- delete_preset(name)[source]¶
- Parameters:
name (
str
) – preset name to remove- Returns:
True
for success,False
if e.g. there is no preset with that name- Return type:
Delete the given preset.
- get_meta(name, tag)[source]¶
- Parameters:
- Returns:
True
for success,False
if e.g. there is no preset with that name or no value for the given tag- value:
value
- Return type:
Gets the value for an existing meta data tag. Meta data tag names can be something like e.g. “comment”. Returned values need to be released when done.
- get_preset_names()[source]¶
- Returns:
list with names, use
GLib.strfreev
() after usage.- Return type:
[
str
]
Get a copy of preset names as a
None
terminated string array.
- get_property_names()[source]¶
- Returns:
an array of property names which should be freed with
GLib.strfreev
() after use.- Return type:
[
str
]
Get a the names of the
GObject.Object
properties that can be used for presets.
- is_editable()[source]¶
-
Check if one can add new presets, change existing ones and remove presets.
New in version 1.6.
- load_preset(name)[source]¶
- Parameters:
name (
str
) – preset name to load- Returns:
True
for success,False
if e.g. there is no preset with that name- Return type:
Load the given preset.
- rename_preset(old_name, new_name)[source]¶
-
Renames a preset. If there is already a preset by the new_name it will be overwritten.
- save_preset(name)[source]¶
-
Save the current object settings as a preset under the given name. If there is already a preset by this name it will be overwritten.
- set_meta(name, tag, value)[source]¶
-
Sets a new value for an existing meta data item or adds a new item. Meta data tag names can be something like e.g. “comment”. Supplying
None
for the value will unset an existing value.
- do_delete_preset(name) virtual¶
- Parameters:
name (
str
) – preset name to remove- Returns:
True
for success,False
if e.g. there is no preset with that name- Return type:
Delete the given preset.
- do_get_meta(name, tag) virtual¶
- Parameters:
- Returns:
True
for success,False
if e.g. there is no preset with that name or no value for the given tag- value:
value
- Return type:
Gets the value for an existing meta data tag. Meta data tag names can be something like e.g. “comment”. Returned values need to be released when done.
- do_get_preset_names() virtual¶
- Returns:
list with names, use
GLib.strfreev
() after usage.- Return type:
[
str
]
Get a copy of preset names as a
None
terminated string array.
- do_get_property_names() virtual¶
- Returns:
an array of property names which should be freed with
GLib.strfreev
() after use.- Return type:
[
str
]
Get a the names of the
GObject.Object
properties that can be used for presets.
- do_load_preset(name) virtual¶
- Parameters:
name (
str
) – preset name to load- Returns:
True
for success,False
if e.g. there is no preset with that name- Return type:
Load the given preset.
- do_rename_preset(old_name, new_name) virtual¶
-
Renames a preset. If there is already a preset by the new_name it will be overwritten.
- do_save_preset(name) virtual¶
-
Save the current object settings as a preset under the given name. If there is already a preset by this name it will be overwritten.
- do_set_meta(name, tag, value) virtual¶
-
Sets a new value for an existing meta data item or adds a new item. Meta data tag names can be something like e.g. “comment”. Supplying
None
for the value will unset an existing value.