Interface Preset
- All Superinterfaces:
Proxy
- All Known Implementing Classes:
AudioEncoder,AudioEncoder.AudioEncoder$Impl,Preset.Preset$Impl,VideoEncoder,VideoEncoder.VideoEncoder$Impl
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 null.
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".
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThe Preset$Impl type represents a native instance of the Preset interface.static classGstPresetinterface. -
Method Summary
Modifier and TypeMethodDescriptiondefault booleandeletePreset(String name) Delete the given preset.static @Nullable StringGets the directory for application specific presets if set by the application.default booleanGets thevaluefor an existing meta datatag.Meta datatagnames can be something like e.g.default String[]Get a copy of preset names as anullterminated string array.default String[]Get a the names of the GObject properties that can be used for presets.static @Nullable TypegetType()Get the GType of the Preset classdefault booleanCheck if one can add new presets, change existing ones and remove presets.default booleanloadPreset(String name) Load the given preset.default booleanrenamePreset(String oldName, String newName) Renames a preset.default booleansavePreset(String name) Save the current object settings as a preset under the given name.static booleanSets an extra directory as an absolute path that should be considered when looking for presets.default booleanSets a newvaluefor an existing meta data item or adds a new item.
-
Method Details
-
getType
-
getAppDir
Gets the directory for application specific presets if set by the application.- Returns:
- the directory or
null, don't free or modify the string
-
setAppDir
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.- Parameters:
appDir- the application specific preset dir- Returns:
truefor success,falseif the dir already has been set
-
deletePreset
Delete the given preset.- Parameters:
name- preset name to remove- Returns:
truefor success,falseif e.g. there is no preset with thatname
-
getMeta
Gets thevaluefor an existing meta datatag.Meta datatagnames can be something like e.g. "comment". Returned values need to be released when done.- Parameters:
name- preset nametag- meta data item namevalue- value- Returns:
truefor success,falseif e.g. there is no preset with thatnameor no value for the giventag
-
getPresetNames
Get a copy of preset names as anullterminated string array.- Returns:
- list with names, use g_strfreev() after usage.
-
getPropertyNames
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 g_strfreev() after use.
-
isEditable
default boolean isEditable()Check if one can add new presets, change existing ones and remove presets.- Returns:
trueif presets are editable orfalseif they are static- Since:
- 1.6
-
loadPreset
Load the given preset.- Parameters:
name- preset name to load- Returns:
truefor success,falseif e.g. there is no preset with thatname
-
renamePreset
-
savePreset
Save the current object settings as a preset under the given name. If there is already a preset by thisnameit will be overwritten.- Parameters:
name- preset name to save- Returns:
truefor success,false
-
setMeta
Sets a newvaluefor an existing meta data item or adds a new item. Meta datatagnames can be something like e.g. "comment". Supplyingnullfor thevaluewill unset an existing value.- Parameters:
name- preset nametag- meta data item namevalue- new value- Returns:
truefor success,falseif e.g. there is no preset with thatname
-