gi-gst-1.0.30: GStreamer bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gst.Interfaces.Preset

Description

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 presetGetPropertyNames. 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 presetSavePreset and presetDeletePreset to Nothing. Applications can use presetIsEditable 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".

Synopsis

Exported types

newtype Preset Source #

Memory-managed wrapper type.

Constructors

Preset (ManagedPtr Preset) 

Instances

Instances details
Eq Preset Source # 
Instance details

Defined in GI.Gst.Interfaces.Preset

Methods

(==) :: Preset -> Preset -> Bool #

(/=) :: Preset -> Preset -> Bool #

BoxedPtr Preset Source # 
Instance details

Defined in GI.Gst.Interfaces.Preset

ManagedPtrNewtype Preset Source # 
Instance details

Defined in GI.Gst.Interfaces.Preset

Methods

toManagedPtr :: Preset -> ManagedPtr Preset

class (ManagedPtrNewtype o, IsDescendantOf Preset o) => IsPreset o Source #

Type class for types which implement Preset.

Instances

Instances details
(ManagedPtrNewtype o, IsDescendantOf Preset o) => IsPreset o Source # 
Instance details

Defined in GI.Gst.Interfaces.Preset

Methods

Click to display all available methods, including inherited ones

Expand

Methods

deletePreset, isEditable, loadPreset, renamePreset, savePreset.

Getters

getMeta, getPresetNames, getPropertyNames.

Setters

setMeta.

deletePreset

presetDeletePreset Source #

Arguments

:: (HasCallStack, MonadIO m, IsPreset a) 
=> a

preset: a Object that implements Preset

-> Text

name: preset name to remove

-> m Bool

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

Delete the given preset.

getAppDir

presetGetAppDir Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m (Maybe [Char])

Returns: the directory or Nothing, don't free or modify the string

Gets the directory for application specific presets if set by the application.

getMeta

presetGetMeta Source #

Arguments

:: (HasCallStack, MonadIO m, IsPreset a) 
=> a

preset: a Object that implements Preset

-> Text

name: preset name

-> Text

tag: meta data item name

-> m (Bool, Text)

Returns: True for success, False if e.g. there is no preset with that name or no value for the given tag

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.

getPresetNames

presetGetPresetNames Source #

Arguments

:: (HasCallStack, MonadIO m, IsPreset a) 
=> a

preset: a Object that implements Preset

-> m [Text]

Returns: list with names, use strfreev after usage.

Get a copy of preset names as a Nothing terminated string array.

getPropertyNames

presetGetPropertyNames Source #

Arguments

:: (HasCallStack, MonadIO m, IsPreset a) 
=> a

preset: a Object that implements Preset

-> m [Text]

Returns: an array of property names which should be freed with strfreev after use.

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

isEditable

presetIsEditable Source #

Arguments

:: (HasCallStack, MonadIO m, IsPreset a) 
=> a

preset: a Object that implements Preset

-> m Bool

Returns: True if presets are editable or False if they are static

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

Since: 1.6

loadPreset

presetLoadPreset Source #

Arguments

:: (HasCallStack, MonadIO m, IsPreset a) 
=> a

preset: a Object that implements Preset

-> Text

name: preset name to load

-> m Bool

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

Load the given preset.

renamePreset

presetRenamePreset Source #

Arguments

:: (HasCallStack, MonadIO m, IsPreset a) 
=> a

preset: a Object that implements Preset

-> Text

oldName: current preset name

-> Text

newName: new preset name

-> m Bool

Returns: True for success, False if e.g. there is no preset with oldName

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

savePreset

presetSavePreset Source #

Arguments

:: (HasCallStack, MonadIO m, IsPreset a) 
=> a

preset: a Object that implements Preset

-> Text

name: preset name to save

-> m Bool

Returns: True for success, False

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.

setAppDir

presetSetAppDir Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> [Char]

appDir: the application specific preset dir

-> m Bool

Returns: True for success, False if the dir already has been set

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.

setMeta

presetSetMeta Source #

Arguments

:: (HasCallStack, MonadIO m, IsPreset a) 
=> a

preset: a Object that implements Preset

-> Text

name: preset name

-> Text

tag: meta data item name

-> Maybe Text

value: new value

-> m Bool

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

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