gstreamermm: Gst::Preset Class Reference

gstreamermm 1.10.0

Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gst::Preset Class Reference
gstreamermm Interfaces

A helper interface for element presets. More...

`#include <gstreamermm/preset.h>`

Inherits Interface.

## Public Member Functions
| Preset (Preset&& src) noexcept
Preset& | operator= (Preset&& src) noexcept
| ~Preset () noexcept override
GstPreset* | gobj ()
| Provides access to the underlying C GObject. More...
const GstPreset* | gobj () const
| Provides access to the underlying C GObject. More...
Glib::StringArrayHandle | get_preset_names () const
| Get a copy of preset names as a `nullptr` terminated string array. More...
Glib::StringArrayHandle | get_property_names () const
| Get a the names of the GObject properties that can be used for presets. More...
bool | load_preset (const Glib::ustring& name)
| Load the given preset. More...
bool | save_preset (const Glib::ustring& name)
| Save the current object settings as a preset under the given name. More...
bool | rename_preset (const Glib::ustring& old_name, const Glib::ustring& new_name)
| Renames a preset. More...
bool | delete_preset (const Glib::ustring& name)
| Delete the given preset. More...
bool | set_meta (const Glib::ustring& name, const Glib::ustring& tag, const Glib::ustring& value)
| Sets a new value for an existing meta data item or adds a new item. More...
bool | is_editable () const
| Check if one can add new presets, change existing ones and remove presets. More...
bool | get_meta (const Glib::ustring& name, const Glib::ustring& tag, Glib::ustring& value) const
| Gets the value for an existing meta data tag. More...
virtual Glib::StringArrayHandle | get_preset_names_vfunc () const
virtual Glib::StringArrayHandle | get_property_names_vfunc () const
virtual bool | load_preset_vfunc (const Glib::ustring& name)
virtual bool | save_preset_vfunc (const Glib::ustring& name) const
virtual bool | rename_preset_vfunc (const Glib::ustring& old_name, const Glib::ustring& new_name)
virtual bool | delete_preset_vfunc (const Glib::ustring& name)
virtual bool | set_meta_vfunc (const Glib::ustring& name, const Glib::ustring& tag, const Glib::ustring& value)
virtual bool | get_meta_vfunc (const Glib::ustring& name, const Glib::ustring& tag, Glib::ustring& value) const

## Static Public Member Functions
static void | add_interface (GType gtype_implementer)
static GType | get_type ()
| Get the GType for this class, for use with the underlying GObject type system. More...

## Protected Member Functions
| Preset ()
| You should derive from this class to use it. More...

## Related Functions
(Note that these are not member functions.)
Glib::RefPtr< Gst::Preset > | wrap (GstPreset* object, bool take_copy=false)
| A Glib::wrap() method for this object. More...

## Detailed Description

A helper interface for element presets.

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 property_names_vfunc(). With that, one can control which properties are saved and in which order.

Last reviewed on 2016-06-06 (1.8.0)

## Constructor & Destructor Documentation

## ◆ Preset() [1/2]

Gst::Preset::Preset | ( |  | ) |
| protected

You should derive from this class to use it.

## ◆ Preset() [2/2]

Gst::Preset::Preset | ( | Preset&& | src | ) |
| noexcept

## ◆ ~Preset()

Gst::Preset::~Preset | ( |  | ) |
| overridenoexcept

## Member Function Documentation

## ◆ add_interface()

static void Gst::Preset::add_interface | ( | GType | gtype_implementer | ) |
| static

## ◆ delete_preset()

bool Gst::Preset::delete_preset | ( | const Glib::ustring & | name | ) |

Delete the given preset.

Parameters

  name | Preset name to remove.

Returns
  `true` for success, `false` if e.g. there is no preset with that name.

## ◆ delete_preset_vfunc()

virtual bool Gst::Preset::delete_preset_vfunc | ( | const Glib::ustring & | name | ) |
| virtual

## ◆ get_meta()

bool Gst::Preset::get_meta | ( | const Glib::ustring & | name,
|  | const Glib::ustring & | tag,
|  | Glib::ustring & | value
| ) |  | const

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.

Parameters

  name | Preset name.
  tag | Meta data item name.
  value | Value.

Returns
  `true` for success, `false` if e.g. there is no preset with that name or no value for the given tag.

## ◆ get_meta_vfunc()

virtual bool Gst::Preset::get_meta_vfunc | ( | const Glib::ustring & | name,
|  | const Glib::ustring & | tag,
|  | Glib::ustring & | value
| ) |  | const
| virtual

## ◆ get_preset_names()

Glib::StringArrayHandle Gst::Preset::get_preset_names | ( |  | ) | const

Get a copy of preset names as a `nullptr` terminated string array.

Returns
  List with names.

## ◆ get_preset_names_vfunc()

virtual Glib::StringArrayHandle Gst::Preset::get_preset_names_vfunc | ( |  | ) | const
| virtual

## ◆ get_property_names()

Glib::StringArrayHandle Gst::Preset::get_property_names | ( |  | ) | const

Get a the names of the GObject properties that can be used for presets.

Returns
  An array of property names which should be freed with Glib::strfreev() after use.

## ◆ get_property_names_vfunc()

virtual Glib::StringArrayHandle Gst::Preset::get_property_names_vfunc | ( |  | ) | const
| virtual

## ◆ get_type()

static GType Gst::Preset::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

## ◆ gobj() [1/2]

GstPreset* Gst::Preset::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const GstPreset* Gst::Preset::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ is_editable()

bool Gst::Preset::is_editable | ( |  | ) | const

Check if one can add new presets, change existing ones and remove presets.

Returns
  `true` if presets are editable or `false` if they are static.

## ◆ load_preset()

bool Gst::Preset::load_preset | ( | const Glib::ustring & | name | ) |

Load the given preset.

Parameters

  name | Preset name to load.

Returns
  `true` for success, `false` if e.g. there is no preset with that name.

## ◆ load_preset_vfunc()

virtual bool Gst::Preset::load_preset_vfunc | ( | const Glib::ustring & | name | ) |
| virtual

## ◆ operator=()

Preset& Gst::Preset::operator= | ( | Preset&& | src | ) |
| noexcept

## ◆ rename_preset()

bool Gst::Preset::rename_preset | ( | const Glib::ustring & | old_name,
|  | const Glib::ustring & | new_name
| ) |  |

Renames a preset.

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

Parameters

  old_name | Current preset name.
  new_name | New preset name.

Returns
  `true` for success, `false` if e.g. there is no preset with old_name.

## ◆ rename_preset_vfunc()

virtual bool Gst::Preset::rename_preset_vfunc | ( | const Glib::ustring & | old_name,
|  | const Glib::ustring & | new_name
| ) |  |
| virtual

## ◆ save_preset()

bool Gst::Preset::save_preset | ( | const Glib::ustring & | name | ) |

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.

Parameters

  name | Preset name to save.

Returns
  `true` for success, `false`.

## ◆ save_preset_vfunc()

virtual bool Gst::Preset::save_preset_vfunc | ( | const Glib::ustring & | name | ) | const
| virtual

## ◆ set_meta()

bool Gst::Preset::set_meta | ( | const Glib::ustring & | name,
|  | const Glib::ustring & | tag,
|  | const Glib::ustring & | value
| ) |  |

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 `nullptr` for the value will unset an existing value.

Parameters

  name | Preset name.
  tag | Meta data item name.
  value | New value.

Returns
  `true` for success, `false` if e.g. there is no preset with that name.

## ◆ set_meta_vfunc()

virtual bool Gst::Preset::set_meta_vfunc | ( | const Glib::ustring & | name,
|  | const Glib::ustring & | tag,
|  | const Glib::ustring & | value
| ) |  |
| virtual

## Friends And Related Function Documentation

## ◆ wrap()

Glib::RefPtr< Gst::Preset > wrap | ( | GstPreset * | object,
|  | bool | take_copy = `false`
| ) |  |
| related

A Glib::wrap() method for this object.

Parameters

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns
  A C++ instance that wraps this C instance.