gi-ges-1.0.4: libges bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.GES.Interfaces.MetaContainer

Description

A Object that implements MetaContainer can have metadata set on it, that is data that is unimportant to its function within GES, but may hold some useful information. In particular, metaContainerSetMeta can be used to store any Value under any generic field (specified by a string key). The same method can also be used to remove the field by passing Nothing. A number of convenience methods are also provided to make it easier to set common value types. The metadata can then be read with metaContainerGetMeta and similar convenience methods.

Registered Fields

By default, any Value can be set for a metadata field. However, you can register some fields as static, that is they only allow values of a specific type to be set under them, using metaContainerRegisterMeta or metaContainerRegisterStaticMeta. The set MetaFlag will determine whether the value can be changed, but even if it can be changed, it must be changed to a value of the same type.

Internally, some GES objects will be initialized with static metadata fields. These will correspond to some standard keys, such as META_VOLUME.

Synopsis

Exported types

newtype MetaContainer Source #

Memory-managed wrapper type.

Constructors

MetaContainer (ManagedPtr MetaContainer) 

Instances

Instances details
Eq MetaContainer Source # 
Instance details

Defined in GI.GES.Interfaces.MetaContainer

GObject MetaContainer Source # 
Instance details

Defined in GI.GES.Interfaces.MetaContainer

ManagedPtrNewtype MetaContainer Source # 
Instance details

Defined in GI.GES.Interfaces.MetaContainer

Methods

toManagedPtr :: MetaContainer -> ManagedPtr MetaContainer

TypedObject MetaContainer Source # 
Instance details

Defined in GI.GES.Interfaces.MetaContainer

Methods

glibType :: IO GType

HasParentTypes MetaContainer Source # 
Instance details

Defined in GI.GES.Interfaces.MetaContainer

IsGValue (Maybe MetaContainer) Source #

Convert MetaContainer to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.GES.Interfaces.MetaContainer

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe MetaContainer -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe MetaContainer)

type ParentTypes MetaContainer Source # 
Instance details

Defined in GI.GES.Interfaces.MetaContainer

type ParentTypes MetaContainer = '[Object]

class (GObject o, IsDescendantOf MetaContainer o) => IsMetaContainer o Source #

Type class for types which can be safely cast to MetaContainer, for instance with toMetaContainer.

Instances

Instances details
(GObject o, IsDescendantOf MetaContainer o) => IsMetaContainer o Source # 
Instance details

Defined in GI.GES.Interfaces.MetaContainer

toMetaContainer :: (MonadIO m, IsMetaContainer o) => o -> m MetaContainer Source #

Cast to MetaContainer, for types for which this is known to be safe. For general casts, use castTo.

Methods

addMetasFromString

metaContainerAddMetasFromString Source #

Arguments

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

container: A MetaContainer

-> Text

str: A string to deserialize and add to container

-> m Bool

Returns: True if the fields in str was successfully deserialized and added to container.

Deserializes the given string, and adds and sets the found fields and their values on the container. The string should be the return of metaContainerMetasToString.

checkMetaRegistered

metaContainerCheckMetaRegistered Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to check

-> m (Bool, [MetaFlag], GType)

Returns: True if the metaItem field has been registered on container.

Checks whether the specified field has been registered as static, and gets the registered type and flags of the field, as used in metaContainerRegisterMeta and metaContainerRegisterStaticMeta.

foreach

metaContainerForeach Source #

Arguments

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

container: A MetaContainer

-> MetaForeachFunc

func: A function to call on each of container's set metadata fields

-> m () 

Calls the given function on each of the meta container's set metadata fields.

getBoolean

metaContainerGetBoolean Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to get

-> m (Bool, Bool)

Returns: True if the boolean value under metaItem was copied to dest.

Gets the current boolean value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

getDate

metaContainerGetDate Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to get

-> m (Bool, Date)

Returns: True if the date value under metaItem was copied to dest.

Gets the current date value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

getDateTime

metaContainerGetDateTime Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to get

-> m (Bool, DateTime)

Returns: True if the date time value under metaItem was copied to dest.

Gets the current date time value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

getDouble

metaContainerGetDouble Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to get

-> m (Bool, Double)

Returns: True if the double value under metaItem was copied to dest.

Gets the current double value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

getFloat

metaContainerGetFloat Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to get

-> m (Bool, Float)

Returns: True if the float value under metaItem was copied to dest.

Gets the current float value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

getInt

metaContainerGetInt Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to get

-> m (Bool, Int32)

Returns: True if the int value under metaItem was copied to dest.

Gets the current int value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

getInt64

metaContainerGetInt64 Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to get

-> m (Bool, Int64)

Returns: True if the int64 value under metaItem was copied to dest.

Gets the current int64 value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

getMarkerList

metaContainerGetMarkerList Source #

Arguments

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

container: A MetaContainer

-> Text

key: The key for the container field to get

-> m (Maybe MarkerList)

Returns: A copy of the marker list value under key, or Nothing if it could not be fetched.

Gets the current marker list value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

Since: 1.18

getMeta

metaContainerGetMeta Source #

Arguments

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

container: A MetaContainer

-> Text

key: The key for the container field to get

-> m (Maybe GValue)

Returns: The value under key, or Nothing if container does not have the field set.

Gets the current value of the specified field of the meta container.

getString

metaContainerGetString Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to get

-> m (Maybe Text)

Returns: The string value under metaItem, or Nothing if it could not be fetched.

Gets the current string value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

getUint

metaContainerGetUint Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to get

-> m (Bool, Word32)

Returns: True if the uint value under metaItem was copied to dest.

Gets the current uint value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

getUint64

metaContainerGetUint64 Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to get

-> m (Bool, Word64)

Returns: True if the uint64 value under metaItem was copied to dest.

Gets the current uint64 value of the specified field of the meta container. If the field does not have a set value, or it is of the wrong type, the method will fail.

metasToString

metaContainerMetasToString Source #

Arguments

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

container: A MetaContainer

-> m Text

Returns: A serialized container.

Serializes the set metadata fields of the meta container to a string.

registerMeta

metaContainerRegisterMeta Source #

Arguments

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

container: A MetaContainer

-> [MetaFlag]

flags: Flags to be used for the registered field

-> Text

metaItem: The key for the container field to register

-> GValue

value: The value to set for the registered field

-> m Bool

Returns: True if the metaItem field was successfully registered on container to only hold value types, with the given flags, and the field was successfully set to value.

Sets the value of the specified field of the meta container to the given value, and registers the field to only hold a value of the same type. After calling this, only values of the same type as value can be set for this field. The given flags can be set to make this field only readable after calling this method.

registerMetaBoolean

metaContainerRegisterMetaBoolean Source #

Arguments

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

container: A MetaContainer

-> [MetaFlag]

flags: Flags to be used for the registered field

-> Text

metaItem: The key for the container field to register

-> Bool

value: The value to set for the registered field

-> m Bool

Returns: True if the metaItem field was successfully registered on container to only hold boolean typed values, with the given flags, and the field was successfully set to value.

Sets the value of the specified field of the meta container to the given boolean value, and registers the field to only hold a boolean typed value. After calling this, only boolean values can be set for this field. The given flags can be set to make this field only readable after calling this method.

registerMetaDate

metaContainerRegisterMetaDate Source #

Arguments

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

container: A MetaContainer

-> [MetaFlag]

flags: Flags to be used for the registered field

-> Text

metaItem: The key for the container field to register

-> Date

value: The value to set for the registered field

-> m Bool

Returns: True if the metaItem field was successfully registered on container to only hold date typed values, with the given flags, and the field was successfully set to value.

Sets the value of the specified field of the meta container to the given date value, and registers the field to only hold a date typed value. After calling this, only date values can be set for this field. The given flags can be set to make this field only readable after calling this method.

registerMetaDateTime

metaContainerRegisterMetaDateTime Source #

Arguments

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

container: A MetaContainer

-> [MetaFlag]

flags: Flags to be used for the registered field

-> Text

metaItem: The key for the container field to register

-> DateTime

value: The value to set for the registered field

-> m Bool

Returns: True if the metaItem field was successfully registered on container to only hold date time typed values, with the given flags, and the field was successfully set to value.

Sets the value of the specified field of the meta container to the given date time value, and registers the field to only hold a date time typed value. After calling this, only date time values can be set for this field. The given flags can be set to make this field only readable after calling this method.

registerMetaDouble

metaContainerRegisterMetaDouble Source #

Arguments

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

container: A MetaContainer

-> [MetaFlag]

flags: Flags to be used for the registered field

-> Text

metaItem: The key for the container field to register

-> Double

value: The value to set for the registered field

-> m Bool

Returns: True if the metaItem field was successfully registered on container to only hold double typed values, with the given flags, and the field was successfully set to value.

Sets the value of the specified field of the meta container to the given double value, and registers the field to only hold a double typed value. After calling this, only double values can be set for this field. The given flags can be set to make this field only readable after calling this method.

registerMetaFloat

metaContainerRegisterMetaFloat Source #

Arguments

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

container: A MetaContainer

-> [MetaFlag]

flags: Flags to be used for the registered field

-> Text

metaItem: The key for the container field to register

-> Float

value: The value to set for the registered field

-> m Bool

Returns: True if the metaItem field was successfully registered on container to only hold float typed values, with the given flags, and the field was successfully set to value.

Sets the value of the specified field of the meta container to the given float value, and registers the field to only hold a float typed value. After calling this, only float values can be set for this field. The given flags can be set to make this field only readable after calling this method.

registerMetaInt

metaContainerRegisterMetaInt Source #

Arguments

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

container: A MetaContainer

-> [MetaFlag]

flags: Flags to be used for the registered field

-> Text

metaItem: The key for the container field to register

-> Int32

value: The value to set for the registered field

-> m Bool

Returns: True if the metaItem field was successfully registered on container to only hold int typed values, with the given flags, and the field was successfully set to value.

Sets the value of the specified field of the meta container to the given int value, and registers the field to only hold an int typed value. After calling this, only int values can be set for this field. The given flags can be set to make this field only readable after calling this method.

registerMetaInt64

metaContainerRegisterMetaInt64 Source #

Arguments

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

container: A MetaContainer

-> [MetaFlag]

flags: Flags to be used for the registered field

-> Text

metaItem: The key for the container field to register

-> Int64

value: The value to set for the registered field

-> m Bool

Returns: True if the metaItem field was successfully registered on container to only hold int64 typed values, with the given flags, and the field was successfully set to value.

Sets the value of the specified field of the meta container to the given int64 value, and registers the field to only hold an int64 typed value. After calling this, only int64 values can be set for this field. The given flags can be set to make this field only readable after calling this method.

registerMetaString

metaContainerRegisterMetaString Source #

Arguments

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

container: A MetaContainer

-> [MetaFlag]

flags: Flags to be used for the registered field

-> Text

metaItem: The key for the container field to register

-> Text

value: The value to set for the registered field

-> m Bool

Returns: True if the metaItem field was successfully registered on container to only hold string typed values, with the given flags, and the field was successfully set to value.

Sets the value of the specified field of the meta container to the given string value, and registers the field to only hold a string typed value. After calling this, only string values can be set for this field. The given flags can be set to make this field only readable after calling this method.

registerMetaUint

metaContainerRegisterMetaUint Source #

Arguments

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

container: A MetaContainer

-> [MetaFlag]

flags: Flags to be used for the registered field

-> Text

metaItem: The key for the container field to register

-> Word32

value: The value to set for the registered field

-> m Bool

Returns: True if the metaItem field was successfully registered on container to only hold uint typed values, with the given flags, and the field was successfully set to value.

Sets the value of the specified field of the meta container to the given uint value, and registers the field to only hold a uint typed value. After calling this, only uint values can be set for this field. The given flags can be set to make this field only readable after calling this method.

registerMetaUint64

metaContainerRegisterMetaUint64 Source #

Arguments

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

container: A MetaContainer

-> [MetaFlag]

flags: Flags to be used for the registered field

-> Text

metaItem: The key for the container field to register

-> Word64

value: The value to set for the registered field

-> m Bool

Returns: True if the metaItem field was successfully registered on container to only hold uint64 typed values, with the given flags, and the field was successfully set to value.

Sets the value of the specified field of the meta container to the given uint64 value, and registers the field to only hold a uint64 typed value. After calling this, only uint64 values can be set for this field. The given flags can be set to make this field only readable after calling this method.

registerStaticMeta

metaContainerRegisterStaticMeta Source #

Arguments

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

container: A MetaContainer

-> [MetaFlag]

flags: Flags to be used for the registered field

-> Text

metaItem: The key for the container field to register

-> GType

type: The required value type for the registered field

-> m Bool

Returns: True if the metaItem field was successfully registered on container to only hold type values, with the given flags.

Registers a static metadata field on the container to only hold the specified type. After calling this, setting a value under this field can only succeed if its type matches the registered type of the field.

Unlike metaContainerRegisterMeta, no (initial) value is set for this field, which means you can use this method to reserve the space to be _optionally_ set later.

Note that if a value has already been set for the field being registered, then its type must match the registering type, and its value will be left in place. If the field has no set value, then you will likely want to include GES_META_WRITABLE in flags to allow the value to be set later.

Since: 1.18

setBoolean

metaContainerSetBoolean Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to set

-> Bool

value: The value to set under metaItem

-> m Bool

Returns: True if value was set under metaItem for container.

Sets the value of the specified field of the meta container to the given boolean value.

setDate

metaContainerSetDate Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to set

-> Date

value: The value to set under metaItem

-> m Bool

Returns: True if value was set under metaItem for container.

Sets the value of the specified field of the meta container to the given date value.

setDateTime

metaContainerSetDateTime Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to set

-> DateTime

value: The value to set under metaItem

-> m Bool

Returns: True if value was set under metaItem for container.

Sets the value of the specified field of the meta container to the given date time value.

setDouble

metaContainerSetDouble Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to set

-> Double

value: The value to set under metaItem

-> m Bool

Returns: True if value was set under metaItem for container.

Sets the value of the specified field of the meta container to the given double value.

setFloat

metaContainerSetFloat Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to set

-> Float

value: The value to set under metaItem

-> m Bool

Returns: True if value was set under metaItem for container.

Sets the value of the specified field of the meta container to the given float value.

setInt

metaContainerSetInt Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to set

-> Int32

value: The value to set under metaItem

-> m Bool

Returns: True if value was set under metaItem for container.

Sets the value of the specified field of the meta container to the given int value.

setInt64

metaContainerSetInt64 Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to set

-> Int64

value: The value to set under metaItem

-> m Bool

Returns: True if value was set under metaItem for container.

Sets the value of the specified field of the meta container to the given int64 value.

setMarkerList

metaContainerSetMarkerList Source #

Arguments

:: (HasCallStack, MonadIO m, IsMetaContainer a, IsMarkerList b) 
=> a

container: A MetaContainer

-> Text

metaItem: The key for the container field to set

-> b

list: The value to set under metaItem

-> m Bool

Returns: True if value was set under metaItem for container.

Sets the value of the specified field of the meta container to the given marker list value.

Since: 1.18

setMeta

metaContainerSetMeta Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to set

-> Maybe GValue

value: The value to set under metaItem, or Nothing to remove the corresponding field

-> m Bool

Returns: True if value was set under metaItem for container.

Sets the value of the specified field of the meta container to a copy of the given value. If the given value is Nothing, the field given by metaItem is removed and True is returned.

setString

metaContainerSetString Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to set

-> Text

value: The value to set under metaItem

-> m Bool

Returns: True if value was set under metaItem for container.

Sets the value of the specified field of the meta container to the given string value.

setUint

metaContainerSetUint Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to set

-> Word32

value: The value to set under metaItem

-> m Bool

Returns: True if value was set under metaItem for container.

Sets the value of the specified field of the meta container to the given uint value.

setUint64

metaContainerSetUint64 Source #

Arguments

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

container: A MetaContainer

-> Text

metaItem: The key for the container field to set

-> Word64

value: The value to set under metaItem

-> m Bool

Returns: True if value was set under metaItem for container.

Sets the value of the specified field of the meta container to the given uint64 value.

Signals

notifyMeta

type MetaContainerNotifyMetaCallback Source #

Arguments

 = Text

key: The key for the container field that changed

-> Maybe GValue

value: The new value under key

-> IO () 

This is emitted for a meta container whenever the metadata under one of its fields changes, is set for the first time, or is removed. In the latter case, value will be Nothing.

afterMetaContainerNotifyMeta :: (IsMetaContainer a, MonadIO m) => a -> Maybe Text -> ((?self :: a) => MetaContainerNotifyMetaCallback) -> m SignalHandlerId Source #

Connect a signal handler for the notifyMeta signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after metaContainer #notifyMeta callback

This signal admits a optional parameter detail. If it's not Nothing, we will connect to “notify-meta::detail” instead.

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onMetaContainerNotifyMeta :: (IsMetaContainer a, MonadIO m) => a -> Maybe Text -> ((?self :: a) => MetaContainerNotifyMetaCallback) -> m SignalHandlerId Source #

Connect a signal handler for the notifyMeta signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on metaContainer #notifyMeta callback

This signal admits a optional parameter detail. If it's not Nothing, we will connect to “notify-meta::detail” instead.