Gst.Preset

g GObject.GInterface GObject.GInterface Gst.Preset Gst.Preset GObject.GInterface->Gst.Preset

Implementations:
 None

Methods

class get_app_dir ()
class set_app_dir (app_dir)
  delete_preset (name)
  get_meta (name, tag)
  get_preset_names ()
  get_property_names ()
  is_editable ()
  load_preset (name)
  rename_preset (old_name, new_name)
  save_preset (name)
  set_meta (name, tag, value)

Virtual Methods

  do_delete_preset (name)
  do_get_meta (name, tag)
  do_get_preset_names ()
  do_get_property_names ()
  do_load_preset (name)
  do_rename_preset (old_name, new_name)
  do_save_preset (name)
  do_set_meta (name, tag, value)

Properties

None

Signals

None

Fields

None

Class Details

class Gst.Preset
Bases:GObject.GInterface
Structure:Gst.PresetInterface

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 for Gst.Preset.save_preset() and Gst.Preset.delete_preset() to None. Applications can use Gst.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]
Returns:the directory or None, don’t free or modify the string
Return type:str or None

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:True for success, False if the dir already has been set
Return type:bool

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:bool

Delete the given preset.

get_meta(name, tag)[source]
Parameters:
  • name (str) – preset name
  • tag (str) – meta data item name
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:

(bool, value: str)

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]
Returns:True if presets are editable or False if they are static
Return type:bool

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:bool

Load the given preset.

rename_preset(old_name, new_name)[source]
Parameters:
  • old_name (str) – current preset name
  • new_name (str) – new preset name
Returns:

True for success, False if e.g. there is no preset with old_name

Return type:

bool

Renames a preset. If there is already a preset by the new_name it will be overwritten.

save_preset(name)[source]
Parameters:name (str) – preset name to save
Returns:True for success, False
Return type:bool

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]
Parameters:
  • name (str) – preset name
  • tag (str) – meta data item name
  • value (str or None) – new value
Returns:

True for success, False if e.g. there is no preset with that name

Return type:

bool

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:bool

Delete the given preset.

do_get_meta(name, tag) virtual
Parameters:
  • name (str) – preset name
  • tag (str) – meta data item name
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:

(bool, value: str)

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:bool

Load the given preset.

do_rename_preset(old_name, new_name) virtual
Parameters:
  • old_name (str) – current preset name
  • new_name (str) – new preset name
Returns:

True for success, False if e.g. there is no preset with old_name

Return type:

bool

Renames a preset. If there is already a preset by the new_name it will be overwritten.

do_save_preset(name) virtual
Parameters:name (str) – preset name to save
Returns:True for success, False
Return type:bool

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
Parameters:
  • name (str) – preset name
  • tag (str) – meta data item name
  • value (str or None) – new value
Returns:

True for success, False if e.g. there is no preset with that name

Return type:

bool

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.