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.Objects.Layer

Description

Layer-s are responsible for collecting and ordering Clip-s.

A layer within a timeline will have an associated priority, corresponding to their index within the timeline. A layer with the index/priority 0 will have the highest priority and the layer with the largest index will have the lowest priority (the order of priorities, in this sense, is the _reverse_ of the numerical ordering of the indices). timelineMoveLayer should be used if you wish to change how layers are prioritised in a timeline.

Layers with higher priorities will have their content priorities over content from lower priority layers, similar to how layers are used in image editing. For example, if two separate layers both display video content, then the layer with the higher priority will have its images shown first. The other layer will only have its image shown if the higher priority layer has no content at the given playtime, or is transparent in some way. Audio content in separate layers will simply play in addition.

Synopsis

Exported types

newtype Layer Source #

Memory-managed wrapper type.

Constructors

Layer (ManagedPtr Layer) 

Instances

Instances details
Eq Layer Source # 
Instance details

Defined in GI.GES.Objects.Layer

Methods

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

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

GObject Layer Source # 
Instance details

Defined in GI.GES.Objects.Layer

ManagedPtrNewtype Layer Source # 
Instance details

Defined in GI.GES.Objects.Layer

Methods

toManagedPtr :: Layer -> ManagedPtr Layer

TypedObject Layer Source # 
Instance details

Defined in GI.GES.Objects.Layer

Methods

glibType :: IO GType

HasParentTypes Layer Source # 
Instance details

Defined in GI.GES.Objects.Layer

IsGValue (Maybe Layer) Source #

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

Instance details

Defined in GI.GES.Objects.Layer

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes Layer Source # 
Instance details

Defined in GI.GES.Objects.Layer

type ParentTypes Layer = '[Object, Extractable, MetaContainer]

class (GObject o, IsDescendantOf Layer o) => IsLayer o Source #

Type class for types which can be safely cast to Layer, for instance with toLayer.

Instances

Instances details
(GObject o, IsDescendantOf Layer o) => IsLayer o Source # 
Instance details

Defined in GI.GES.Objects.Layer

toLayer :: (MonadIO m, IsLayer o) => o -> m Layer Source #

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

Methods

addAsset

layerAddAsset Source #

Arguments

:: (HasCallStack, MonadIO m, IsLayer a, IsAsset b) 
=> a

layer: The Layer

-> b

asset: The asset to extract the new clip from

-> Word64

start: The TimelineElement:start value to set on the new clip If start == #GST_CLOCK_TIME_NONE, it will be added to the end of layer, i.e. it will be set to layer's duration

-> Word64

inpoint: The TimelineElement:inPoint value to set on the new clip

-> Word64

duration: The TimelineElement:duration value to set on the new clip

-> [TrackType]

trackTypes: The Clip:supportedFormats to set on the the new clip, or GES_TRACK_TYPE_UNKNOWN to use the default

-> m (Maybe Clip)

Returns: The newly created clip.

See layerAddAssetFull, which also gives an error.

addAssetFull

layerAddAssetFull Source #

Arguments

:: (HasCallStack, MonadIO m, IsLayer a, IsAsset b) 
=> a

layer: The Layer

-> b

asset: The asset to extract the new clip from

-> Word64

start: The TimelineElement:start value to set on the new clip If start == #GST_CLOCK_TIME_NONE, it will be added to the end of layer, i.e. it will be set to layer's duration

-> Word64

inpoint: The TimelineElement:inPoint value to set on the new clip

-> Word64

duration: The TimelineElement:duration value to set on the new clip

-> [TrackType]

trackTypes: The Clip:supportedFormats to set on the the new clip, or GES_TRACK_TYPE_UNKNOWN to use the default

-> m Clip

Returns: The newly created clip. (Can throw GError)

Extracts a new clip from an asset and adds it to the layer with the given properties.

Since: 1.18

addClip

layerAddClip Source #

Arguments

:: (HasCallStack, MonadIO m, IsLayer a, IsClip b) 
=> a

layer: The Layer

-> b

clip: The clip to add

-> m Bool

Returns: True if clip was properly added to layer, or False if layer refused to add clip.

See layerAddClipFull, which also gives an error.

addClipFull

layerAddClipFull Source #

Arguments

:: (HasCallStack, MonadIO m, IsLayer a, IsClip b) 
=> a

layer: The Layer

-> b

clip: The clip to add

-> m ()

(Can throw GError)

Adds the given clip to the layer. If the method succeeds, the layer will take ownership of the clip.

This method will fail and return False if clip already resides in some layer. It can also fail if the additional clip breaks some compositional rules (see TimelineElement).

Since: 1.18

getActiveForTrack

layerGetActiveForTrack Source #

Arguments

:: (HasCallStack, MonadIO m, IsLayer a, IsTrack b) 
=> a

layer: The Layer

-> b

track: The Track to check if layer is currently active for

-> m Bool

Returns: True if layer is active for track, or False otherwise.

Gets whether the layer is active for the given track. See layerSetActiveForTracks.

Since: 1.18

getAutoTransition

layerGetAutoTransition Source #

Arguments

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

layer: The Layer

-> m Bool

Returns: True if transitions are automatically added to layer.

Gets the Layer:autoTransition of the layer.

getClips

layerGetClips Source #

Arguments

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

layer: The Layer

-> m [Clip]

Returns: A list of clips in layer.

Get the Clip-s contained in this layer.

getClipsInInterval

layerGetClipsInInterval Source #

Arguments

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

layer: The Layer

-> Word64

start: Start of the interval

-> Word64

end: End of the interval

-> m [Clip]

Returns: A list of Clip-s that intersect the interval [start, end) in layer.

Gets the clips within the layer that appear between start and end.

getDuration

layerGetDuration Source #

Arguments

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

layer: The layer to get the duration from

-> m Word64

Returns: The duration of layer.

Retrieves the duration of the layer, which is the difference between the start of the layer (always time 0) and the end (which will be the end time of the final clip).

getPriority

layerGetPriority Source #

Arguments

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

layer: The Layer

-> m Word32

Returns: The priority of layer within its timeline.

Get the priority of the layer. When inside a timeline, this is its index in the timeline. See timelineMoveLayer.

getTimeline

layerGetTimeline Source #

Arguments

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

layer: The Layer

-> m (Maybe Timeline)

Returns: The timeline that layer is currently part of, or Nothing if it is not associated with any timeline.

Gets the timeline that the layer is a part of.

isEmpty

layerIsEmpty Source #

Arguments

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

layer: The Layer to check

-> m Bool

Returns: True if layer is empty, False if it contains at least one clip.

Convenience method to check if the layer is empty (doesn't contain any Clip), or not.

new

layerNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Layer

Returns: A new layer.

Creates a new layer.

removeClip

layerRemoveClip Source #

Arguments

:: (HasCallStack, MonadIO m, IsLayer a, IsClip b) 
=> a

layer: The Layer

-> b

clip: The clip to remove

-> m Bool

Returns: True if clip was removed from layer, or False if the operation failed.

Removes the given clip from the layer.

setActiveForTracks

layerSetActiveForTracks Source #

Arguments

:: (HasCallStack, MonadIO m, IsLayer a, IsTrack b) 
=> a

layer: The Layer

-> Bool

active: Whether elements in tracks should be active or not

-> [b]

tracks: The list of tracks layer should be (de-)active in, or Nothing to include all the tracks in the layer's timeline

-> m Bool

Returns: True if the operation worked False otherwise.

Activate or deactivate track elements in tracks (or in all tracks if tracks is Nothing).

When a layer is deactivated for a track, all the TrackElement-s in the track that belong to a Clip in the layer will no longer be active in the track, regardless of their individual TrackElement:active value.

Note that by default a layer will be active for all of its timeline's tracks.

Since: 1.18

setAutoTransition

layerSetAutoTransition Source #

Arguments

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

layer: The Layer

-> Bool

autoTransition: Whether transitions should be automatically added to the layer

-> m () 

Sets Layer:autoTransition for the layer. Use timelineSetAutoTransition if you want all layers within a Timeline to have Layer:autoTransition set to True. Use this method if you want different values for different layers (and make sure to keep Timeline:autoTransition as False for the corresponding timeline).

setPriority

layerSetPriority Source #

Arguments

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

layer: The Layer

-> Word32

priority: The priority to set

-> m () 

Deprecated: (Since version 1.16.0)use ges_timeline_move_layer instead. This deprecation meansthat you will not need to handle layer priorities at all yourself, GESwill make sure there is never 'gaps' between layer priorities.

Sets the layer to the given priority. See Layer:priority.

setTimeline

layerSetTimeline :: (HasCallStack, MonadIO m, IsLayer a, IsTimeline b) => a -> b -> m () Source #

No description available in the introspection data.

Properties

autoTransition

Whether to automatically create a TransitionClip whenever two Source-s that both belong to a Clip in the layer overlap. See Timeline for what counts as an overlap.

When a layer is added to a Timeline, if this property is left as False, but the timeline's Timeline:autoTransition is True, it will be set to True as well.

constructLayerAutoTransition :: (IsLayer o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “auto-transition” property. This is rarely needed directly, but it is used by new.

getLayerAutoTransition :: (MonadIO m, IsLayer o) => o -> m Bool Source #

Get the value of the “auto-transition” property. When overloading is enabled, this is equivalent to

get layer #autoTransition

setLayerAutoTransition :: (MonadIO m, IsLayer o) => o -> Bool -> m () Source #

Set the value of the “auto-transition” property. When overloading is enabled, this is equivalent to

set layer [ #autoTransition := value ]

priority

The priority of the layer in the Timeline. 0 is the highest priority. Conceptually, a timeline is a stack of layers, and the priority of the layer represents its position in the stack. Two layers should not have the same priority within a given GESTimeline.

Note that the timeline needs to be committed (with ges_timeline_commit) for the change to be taken into account.

constructLayerPriority :: (IsLayer o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “priority” property. This is rarely needed directly, but it is used by new.

getLayerPriority :: (MonadIO m, IsLayer o) => o -> m Word32 Source #

Get the value of the “priority” property. When overloading is enabled, this is equivalent to

get layer #priority

setLayerPriority :: (MonadIO m, IsLayer o) => o -> Word32 -> m () Source #

Set the value of the “priority” property. When overloading is enabled, this is equivalent to

set layer [ #priority := value ]

Signals

activeChanged

type LayerActiveChangedCallback Source #

Arguments

 = Bool

active: Whether layer has been made active or de-active in the tracks

-> [Track]

tracks: A list of Track which have been activated or deactivated

-> IO () 

Will be emitted whenever the layer is activated or deactivated for some Track. See layerSetActiveForTracks.

Since: 1.18

afterLayerActiveChanged :: (IsLayer a, MonadIO m) => a -> ((?self :: a) => LayerActiveChangedCallback) -> m SignalHandlerId Source #

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

after layer #activeChanged callback

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.

onLayerActiveChanged :: (IsLayer a, MonadIO m) => a -> ((?self :: a) => LayerActiveChangedCallback) -> m SignalHandlerId Source #

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

on layer #activeChanged callback

clipAdded

type LayerClipAddedCallback Source #

Arguments

 = Clip

clip: The clip that was added

-> IO () 

Will be emitted after the clip is added to the layer.

afterLayerClipAdded :: (IsLayer a, MonadIO m) => a -> ((?self :: a) => LayerClipAddedCallback) -> m SignalHandlerId Source #

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

after layer #clipAdded callback

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.

onLayerClipAdded :: (IsLayer a, MonadIO m) => a -> ((?self :: a) => LayerClipAddedCallback) -> m SignalHandlerId Source #

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

on layer #clipAdded callback

clipRemoved

type LayerClipRemovedCallback Source #

Arguments

 = Clip

clip: The clip that was removed

-> IO () 

Will be emitted after the clip is removed from the layer.

afterLayerClipRemoved :: (IsLayer a, MonadIO m) => a -> ((?self :: a) => LayerClipRemovedCallback) -> m SignalHandlerId Source #

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

after layer #clipRemoved callback

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.

onLayerClipRemoved :: (IsLayer a, MonadIO m) => a -> ((?self :: a) => LayerClipRemovedCallback) -> m SignalHandlerId Source #

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

on layer #clipRemoved callback