Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Exported types
- Methods
- addLayer
- addTrack
- appendLayer
- commit
- commitSync
- disableEditApis
- freezeCommit
- getAutoTransition
- getDuration
- getEditApisDisabled
- getElement
- getFrameAt
- getFrameTime
- getGroups
- getLayer
- getLayers
- getPadForTrack
- getSnappingDistance
- getTrackForPad
- getTracks
- isEmpty
- loadFromUri
- moveLayer
- new
- newAudioVideo
- newFromUri
- pasteElement
- removeLayer
- removeTrack
- saveToUri
- setAutoTransition
- setSnappingDistance
- thawCommit
- Properties
- Signals
Timeline
is the central object for any multimedia timeline.
A timeline is composed of a set of Track
-s and a set of
Layer
-s, which are added to the timeline using
timelineAddTrack
and timelineAppendLayer
, respectively.
The contained tracks define the supported types of the timeline
and provide the media output. Essentially, each track provides an
additional source Pad
.
Most usage of a timeline will likely only need a single AudioTrack
and/or a single VideoTrack
. You can create such a timeline with
timelineNewAudioVideo
. After this, you are unlikely to need to
work with the tracks directly.
A timeline's layers contain Clip
-s, which in turn control the
creation of TrackElement
-s, which are added to the timeline's
tracks. See Timeline::selectTracksForObject if you wish to have
more control over which track a clip's elements are added to.
The layers are ordered, with higher priority layers having their
content prioritised in the tracks. This ordering can be changed using
timelineMoveLayer
.
Editing
See TimelineElement
for the various ways the elements of a timeline
can be edited.
If you change the timing or ordering of a timeline's
TimelineElement
-s, then these changes will not actually be taken
into account in the output of the timeline's tracks until the
timelineCommit
method is called. This allows you to move its
elements around, say, in response to an end user's mouse dragging, with
little expense before finalising their effect on the produced data.
Overlaps and Auto-Transitions
There are certain restrictions placed on how Source
-s may overlap
in a Track
that belongs to a timeline. These will be enforced by
GES, so the user will not need to keep track of them, but they should
be aware that certain edits will be refused as a result if the overlap
rules would be broken.
Consider two Source
-s, A
and B
, with start times startA
and
startB
, and end times endA
and endB
, respectively. The start
time refers to their TimelineElement:start, and the end time is
their TimelineElement:start + TimelineElement:duration. These
two sources *overlap* if:
+ they share the same TrackElement:track (non Nothing
), which belongs
to the timeline;
+ they share the same GES_TIMELINE_ELEMENT_LAYER_PRIORITY
; and
+ startA < endB
and startB < endA
.
Note that when startA = endB
or startB = endA
then the two sources
will *touch* at their edges, but are not considered overlapping.
If, in addition, startA < startB < endA
, then we can say that the
end of A
overlaps the start of B
.
If, instead, startA <= startB
and endA >= endB
, then we can say
that A
fully overlaps B
.
The overlap rules for a timeline are that:
- One source cannot fully overlap another source.
- A source can only overlap the end of up to one other source at its start.
- A source can only overlap the start of up to one other source at its end.
The last two rules combined essentially mean that at any given timeline
position, only up to two Source
-s may overlap at that position. So
triple or more overlaps are not allowed.
If you switch on Timeline:autoTransition, then at any moment when
the end of one source (the first source) overlaps the start of another
(the second source), a TransitionClip
will be automatically created
for the pair in the same layer and it will cover their overlap. If the
two elements are edited in a way such that the end of the first source
no longer overlaps the start of the second, the transition will be
automatically removed from the timeline. However, if the two sources
still overlap at the same edges after the edit, then the same
transition object will be kept, but with its timing and layer adjusted
accordingly.
NOTE: if you know what you are doing and want to be in full control of the
timeline layout, you can disable the edit APIs with
ges_timeline_disable_edit_apis
.
Saving
To save/load a timeline, you can use the timelineLoadFromUri
and timelineSaveToUri
methods that use the default format.
Playing
A timeline is a Bin
with a source Pad
for each of its
tracks, which you can fetch with timelineGetPadForTrack
. You
will likely want to link these to some compatible sink Element
-s to
be able to play or capture the content of the timeline.
You can use a Pipeline
to easily preview/play the timeline's
content, or render it to a file.
Synopsis
- newtype Timeline = Timeline (ManagedPtr Timeline)
- class (GObject o, IsDescendantOf Timeline o) => IsTimeline o
- toTimeline :: (MonadIO m, IsTimeline o) => o -> m Timeline
- timelineAddLayer :: (HasCallStack, MonadIO m, IsTimeline a, IsLayer b) => a -> b -> m Bool
- timelineAddTrack :: (HasCallStack, MonadIO m, IsTimeline a, IsTrack b) => a -> b -> m Bool
- timelineAppendLayer :: (HasCallStack, MonadIO m, IsTimeline a) => a -> m Layer
- timelineCommit :: (HasCallStack, MonadIO m, IsTimeline a) => a -> m Bool
- timelineCommitSync :: (HasCallStack, MonadIO m, IsTimeline a) => a -> m Bool
- timelineDisableEditApis :: (HasCallStack, MonadIO m, IsTimeline a) => a -> Bool -> m ()
- timelineFreezeCommit :: (HasCallStack, MonadIO m, IsTimeline a) => a -> m ()
- timelineGetAutoTransition :: (HasCallStack, MonadIO m, IsTimeline a) => a -> m Bool
- timelineGetDuration :: (HasCallStack, MonadIO m, IsTimeline a) => a -> m Word64
- timelineGetEditApisDisabled :: (HasCallStack, MonadIO m, IsTimeline a) => a -> m Bool
- timelineGetElement :: (HasCallStack, MonadIO m, IsTimeline a) => a -> Text -> m (Maybe TimelineElement)
- timelineGetFrameAt :: (HasCallStack, MonadIO m, IsTimeline a) => a -> Word64 -> m Int64
- timelineGetFrameTime :: (HasCallStack, MonadIO m, IsTimeline a) => a -> Int64 -> m Word64
- timelineGetGroups :: (HasCallStack, MonadIO m, IsTimeline a) => a -> m [Group]
- timelineGetLayer :: (HasCallStack, MonadIO m, IsTimeline a) => a -> Word32 -> m (Maybe Layer)
- timelineGetLayers :: (HasCallStack, MonadIO m, IsTimeline a) => a -> m [Layer]
- timelineGetPadForTrack :: (HasCallStack, MonadIO m, IsTimeline a, IsTrack b) => a -> b -> m (Maybe Pad)
- timelineGetSnappingDistance :: (HasCallStack, MonadIO m, IsTimeline a) => a -> m Word64
- timelineGetTrackForPad :: (HasCallStack, MonadIO m, IsTimeline a, IsPad b) => a -> b -> m (Maybe Track)
- timelineGetTracks :: (HasCallStack, MonadIO m, IsTimeline a) => a -> m [Track]
- timelineIsEmpty :: (HasCallStack, MonadIO m, IsTimeline a) => a -> m Bool
- timelineLoadFromUri :: (HasCallStack, MonadIO m, IsTimeline a) => a -> Text -> m ()
- timelineMoveLayer :: (HasCallStack, MonadIO m, IsTimeline a, IsLayer b) => a -> b -> Word32 -> m Bool
- timelineNew :: (HasCallStack, MonadIO m) => m Timeline
- timelineNewAudioVideo :: (HasCallStack, MonadIO m) => m Timeline
- timelineNewFromUri :: (HasCallStack, MonadIO m) => Text -> m Timeline
- timelinePasteElement :: (HasCallStack, MonadIO m, IsTimeline a, IsTimelineElement b) => a -> b -> Word64 -> Int32 -> m (Maybe TimelineElement)
- timelineRemoveLayer :: (HasCallStack, MonadIO m, IsTimeline a, IsLayer b) => a -> b -> m Bool
- timelineRemoveTrack :: (HasCallStack, MonadIO m, IsTimeline a, IsTrack b) => a -> b -> m Bool
- timelineSaveToUri :: (HasCallStack, MonadIO m, IsTimeline a, IsAsset b) => a -> Text -> Maybe b -> Bool -> m ()
- timelineSetAutoTransition :: (HasCallStack, MonadIO m, IsTimeline a) => a -> Bool -> m ()
- timelineSetSnappingDistance :: (HasCallStack, MonadIO m, IsTimeline a) => a -> Word64 -> m ()
- timelineThawCommit :: (HasCallStack, MonadIO m, IsTimeline a) => a -> m ()
- constructTimelineAutoTransition :: (IsTimeline o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTimelineAutoTransition :: (MonadIO m, IsTimeline o) => o -> m Bool
- setTimelineAutoTransition :: (MonadIO m, IsTimeline o) => o -> Bool -> m ()
- getTimelineDuration :: (MonadIO m, IsTimeline o) => o -> m Word64
- constructTimelineSnappingDistance :: (IsTimeline o, MonadIO m) => Word64 -> m (GValueConstruct o)
- getTimelineSnappingDistance :: (MonadIO m, IsTimeline o) => o -> m Word64
- setTimelineSnappingDistance :: (MonadIO m, IsTimeline o) => o -> Word64 -> m ()
- type TimelineCommitedCallback = IO ()
- afterTimelineCommited :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineCommitedCallback) -> m SignalHandlerId
- onTimelineCommited :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineCommitedCallback) -> m SignalHandlerId
- type TimelineGroupAddedCallback = Group -> IO ()
- afterTimelineGroupAdded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineGroupAddedCallback) -> m SignalHandlerId
- onTimelineGroupAdded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineGroupAddedCallback) -> m SignalHandlerId
- type TimelineGroupRemovedCallback = Group -> [Container] -> IO ()
- afterTimelineGroupRemoved :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineGroupRemovedCallback) -> m SignalHandlerId
- onTimelineGroupRemoved :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineGroupRemovedCallback) -> m SignalHandlerId
- type TimelineLayerAddedCallback = Layer -> IO ()
- afterTimelineLayerAdded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineLayerAddedCallback) -> m SignalHandlerId
- onTimelineLayerAdded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineLayerAddedCallback) -> m SignalHandlerId
- type TimelineLayerRemovedCallback = Layer -> IO ()
- afterTimelineLayerRemoved :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineLayerRemovedCallback) -> m SignalHandlerId
- onTimelineLayerRemoved :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineLayerRemovedCallback) -> m SignalHandlerId
- type TimelineSelectElementTrackCallback = Clip -> TrackElement -> IO (Maybe Track)
- afterTimelineSelectElementTrack :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSelectElementTrackCallback) -> m SignalHandlerId
- onTimelineSelectElementTrack :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSelectElementTrackCallback) -> m SignalHandlerId
- type TimelineSelectTracksForObjectCallback = Clip -> TrackElement -> IO [Track]
- afterTimelineSelectTracksForObject :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSelectTracksForObjectCallback) -> m SignalHandlerId
- onTimelineSelectTracksForObject :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSelectTracksForObjectCallback) -> m SignalHandlerId
- type TimelineSnappingEndedCallback = TrackElement -> TrackElement -> Word64 -> IO ()
- afterTimelineSnappingEnded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSnappingEndedCallback) -> m SignalHandlerId
- onTimelineSnappingEnded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSnappingEndedCallback) -> m SignalHandlerId
- type TimelineSnappingStartedCallback = TrackElement -> TrackElement -> Word64 -> IO ()
- afterTimelineSnappingStarted :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSnappingStartedCallback) -> m SignalHandlerId
- onTimelineSnappingStarted :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSnappingStartedCallback) -> m SignalHandlerId
- type TimelineTrackAddedCallback = Track -> IO ()
- afterTimelineTrackAdded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineTrackAddedCallback) -> m SignalHandlerId
- onTimelineTrackAdded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineTrackAddedCallback) -> m SignalHandlerId
- type TimelineTrackRemovedCallback = Track -> IO ()
- afterTimelineTrackRemoved :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineTrackRemovedCallback) -> m SignalHandlerId
- onTimelineTrackRemoved :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineTrackRemovedCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
Eq Timeline Source # | |
GObject Timeline Source # | |
Defined in GI.GES.Objects.Timeline | |
ManagedPtrNewtype Timeline Source # | |
Defined in GI.GES.Objects.Timeline toManagedPtr :: Timeline -> ManagedPtr Timeline | |
TypedObject Timeline Source # | |
Defined in GI.GES.Objects.Timeline | |
HasParentTypes Timeline Source # | |
Defined in GI.GES.Objects.Timeline | |
IsGValue (Maybe Timeline) Source # | Convert |
Defined in GI.GES.Objects.Timeline gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Timeline -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Timeline) | |
type ParentTypes Timeline Source # | |
Defined in GI.GES.Objects.Timeline |
class (GObject o, IsDescendantOf Timeline o) => IsTimeline o Source #
Type class for types which can be safely cast to Timeline
, for instance with toTimeline
.
Instances
(GObject o, IsDescendantOf Timeline o) => IsTimeline o Source # | |
Defined in GI.GES.Objects.Timeline |
toTimeline :: (MonadIO m, IsTimeline o) => o -> m Timeline Source #
Methods
Click to display all available methods, including inherited ones
Methods
abortState, add, addControlBinding, addLayer, addMetasFromString, addPad, addPropertyDeepNotifyWatch, addPropertyNotifyWatch, addTrack, appendLayer, bindProperty, bindPropertyFull, callAsync, changeState, checkMetaRegistered, childAdded, childRemoved, commit, commitSync, continueState, createAllPads, defaultError, disableEditApis, findUnlinkedPad, forceFloating, foreach, foreachPad, foreachSinkPad, foreachSrcPad, freezeCommit, freezeNotify, getv, hasActiveControlBindings, hasAncestor, hasAsAncestor, hasAsParent, isEmpty, isFloating, isLockedState, iterateAllByElementFactoryName, iterateAllByInterface, iterateElements, iteratePads, iterateRecurse, iterateSinkPads, iterateSinks, iterateSorted, iterateSources, iterateSrcPads, link, linkFiltered, linkPads, linkPadsFiltered, linkPadsFull, loadFromUri, lookup, lostState, messageFull, messageFullWithDetails, metasToString, moveLayer, noMorePads, notify, notifyByPspec, pasteElement, postMessage, provideClock, query, queryConvert, queryDuration, queryPosition, recalculateLatency, ref, refSink, registerMeta, registerMetaBoolean, registerMetaDate, registerMetaDateTime, registerMetaDouble, registerMetaFloat, registerMetaInt, registerMetaInt64, registerMetaString, registerMetaUint, registerMetaUint64, registerStaticMeta, releaseRequestPad, remove, removeControlBinding, removeLayer, removePad, removePropertyNotifyWatch, removeTrack, requestPad, requestPadSimple, runDispose, saveToUri, seek, seekSimple, sendEvent, stealData, stealQdata, suggestNextSync, syncChildrenStates, syncStateWithParent, syncValues, thawCommit, thawNotify, unlink, unlinkPads, unparent, unref, watchClosure.
Getters
getAsset, getAutoTransition, getBaseTime, getBoolean, getBus, getByInterface, getByName, getByNameRecurseUp, getChildByIndex, getChildByName, getChildByNameRecurse, getChildrenCount, getClock, getCompatiblePad, getCompatiblePadTemplate, getContext, getContextUnlocked, getContexts, getControlBinding, getControlRate, getCurrentClockTime, getCurrentRunningTime, getData, getDate, getDateTime, getDouble, getDuration, getEditApisDisabled, getElement, getFactory, getFloat, getFrameAt, getFrameTime, getGValueArray, getGroups, getId, getInt, getInt64, getLayer, getLayers, getMarkerList, getMeta, getMetadata, getName, getPadForTrack, getPadTemplate, getPadTemplateList, getParent, getPathString, getProperty, getQdata, getRequestPad, getSnappingDistance, getStartTime, getState, getStaticPad, getString, getSuppressedFlags, getTrackForPad, getTracks, getUint, getUint64, getValue.
Setters
setAsset, setAutoTransition, setBaseTime, setBoolean, setBus, setClock, setContext, setControlBindingDisabled, setControlBindingsDisabled, setControlRate, setData, setDataFull, setDate, setDateTime, setDouble, setFloat, setInt, setInt64, setLockedState, setMarkerList, setMeta, setName, setParent, setProperty, setSnappingDistance, setStartTime, setState, setString, setSuppressedFlags, setUint, setUint64.
addLayer
:: (HasCallStack, MonadIO m, IsTimeline a, IsLayer b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
Deprecated: (Since version 1.18)This method requires you to ensure the layer'sLayer:priority will be unique to the timeline. UsetimelineAppendLayer
and timelineMoveLayer
instead.
Add a layer to the timeline.
If the layer contains Clip
-s, then this may trigger the creation of
their core track element children for the timeline's tracks, and the
placement of the clip's children in the tracks of the timeline using
Timeline::selectTracksForObject. Some errors may occur if this
would break one of the configuration rules of the timeline in one of
its tracks. In such cases, some track elements would fail to be added
to their tracks, but this method would still return True
. As such, it
is advised that you only add clips to layers that already part of a
timeline. In such situations, layerAddClip
is able to fail if
adding the clip would cause such an error.
addTrack
:: (HasCallStack, MonadIO m, IsTimeline a, IsTrack b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
Add a track to the timeline.
If the timeline already contains clips, then this may trigger the
creation of their core track element children for the track, and the
placement of the clip's children in the track of the timeline using
Timeline::selectTracksForObject. Some errors may occur if this
would break one of the configuration rules for the timeline in the
track. In such cases, some track elements would fail to be added to the
track, but this method would still return True
. As such, it is advised
that you avoid adding tracks to timelines that already contain clips.
appendLayer
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> m Layer | Returns: The newly created layer. |
Append a newly created layer to the timeline. The layer will be added at the lowest Layer:priority (numerically, the highest).
commit
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> m Bool | Returns: |
Commit all the pending changes of the clips contained in the timeline.
When changes happen in a timeline, they are not immediately executed internally, in a way that effects the output data of the timeline. You should call this method when you are done with a set of changes and you want them to be executed.
Any pending changes will be executed in the backend. The
Timeline::commited signal will be emitted once this has completed.
You should not try to change the state of the timeline, seek it or add
tracks to it before receiving this signal. You can use
timelineCommitSync
if you do not want to perform other tasks in
the mean time.
Note that all the pending changes will automatically be executed when
the timeline goes from GST_STATE_READY
to GST_STATE_PAUSED
, which is
usually triggered by a corresponding state changes in a containing
Pipeline
.
commitSync
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> m Bool | Returns: |
Commit all the pending changes of the clips contained in the timeline and wait for the changes to complete.
See timelineCommit
.
disableEditApis
timelineDisableEditApis Source #
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> Bool |
|
-> m () |
WARNING: When using that mode, GES won't guarantee the coherence of the timeline. You need to ensure that the rules described in the <http://developer.gnome.org/ges/stable/#overlaps-and-autotransitions Overlaps and auto transitions> section are respected any time the timeline is commited (otherwise playback will most probably fail in different ways).
When disabling editing APIs, GES won't be able to enforce the rules that makes the timeline overall state to be valid but some feature won't be usable: * Timeline:snappingDistance * Timeline:autoTransition
Since: 1.22
freezeCommit
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> m () |
Freezes the timeline from being committed. This is usually needed while the
timeline is being rendered to ensure that not change to the timeline are
taken into account during that moment. Once the rendering is done, you
should call ges_timeline_thaw_commit
so that committing becomes possible
again and any call to commit()
that happened during the rendering is
actually taken into account.
Since: 1.20
getAutoTransition
timelineGetAutoTransition Source #
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> m Bool | Returns: The auto-transition of |
Gets Timeline:autoTransition for the timeline.
getDuration
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> m Word64 | Returns: The current duration of |
Get the current Timeline:duration of the timeline
getEditApisDisabled
timelineGetEditApisDisabled Source #
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> m Bool |
No description available in the introspection data.
Since: 1.22
getElement
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> Text |
|
-> m (Maybe TimelineElement) | Returns: The timeline element in |
Gets the element contained in the timeline with the given name.
getFrameAt
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> Word64 |
|
-> m Int64 | Returns: The frame number |
This method allows you to convert a timeline GstClockTime
into its
corresponding GESFrameNumber
in the timeline's output.
Since: 1.18
getFrameTime
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> Int64 |
|
-> m Word64 | Returns: The timestamp corresponding to |
This method allows you to convert a timeline output frame number into a
timeline GstClockTime
. For example, this time could be used to seek to a
particular frame in the timeline's output, or as the edit position for
an element within the timeline.
Since: 1.18
getGroups
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> m [Group] | Returns: The list of
groups that contain clips present in |
Get the list of Group
-s present in the timeline.
getLayer
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> Word32 |
|
-> m (Maybe Layer) | Returns: The layer with the given
Since 1.6 |
Retrieve the layer whose index in the timeline matches the given priority.
getLayers
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> m [Layer] | Returns: The list of
layers present in |
Get the list of Layer
-s present in the timeline.
getPadForTrack
timelineGetPadForTrack Source #
:: (HasCallStack, MonadIO m, IsTimeline a, IsTrack b) | |
=> a |
|
-> b |
|
-> m (Maybe Pad) | Returns: The pad corresponding to |
Search for the Pad
corresponding to the given timeline's track.
You can link to this pad to receive the output data of the given track.
getSnappingDistance
timelineGetSnappingDistance Source #
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> m Word64 | Returns: The snapping distance (in nanoseconds) of |
Gets the Timeline:snappingDistance for the timeline.
getTrackForPad
timelineGetTrackForPad Source #
:: (HasCallStack, MonadIO m, IsTimeline a, IsPad b) | |
=> a |
|
-> b |
|
-> m (Maybe Track) | Returns: The track corresponding to |
Search for the Track
corresponding to the given timeline's pad.
getTracks
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> m [Track] | Returns: The list of tracks
used by |
Get the list of Track
-s used by the timeline.
isEmpty
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> m Bool | Returns: |
Check whether the timeline is empty or not.
loadFromUri
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> Text |
|
-> m () | (Can throw |
Loads the contents of URI into the timeline.
moveLayer
:: (HasCallStack, MonadIO m, IsTimeline a, IsLayer b) | |
=> a |
|
-> b |
|
-> Word32 |
|
-> m Bool |
Moves a layer within the timeline to the index given by
newLayerPriority
.
An index of 0 corresponds to the layer with the highest priority in a
timeline. If newLayerPriority
is greater than the number of layers
present in the timeline, it will become the lowest priority layer.
Since: 1.16
new
:: (HasCallStack, MonadIO m) | |
=> m Timeline | Returns: The new timeline. |
Creates a new empty timeline.
newAudioVideo
timelineNewAudioVideo Source #
:: (HasCallStack, MonadIO m) | |
=> m Timeline | Returns: The new timeline. |
Creates a new timeline containing a single AudioTrack
and a
single VideoTrack
.
newFromUri
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Timeline | Returns: A new timeline if the uri was loaded
successfully, or |
Creates a timeline from the given URI.
pasteElement
:: (HasCallStack, MonadIO m, IsTimeline a, IsTimelineElement b) | |
=> a |
|
-> b |
|
-> Word64 |
|
-> Int32 |
|
-> m (Maybe TimelineElement) | Returns: The newly created element, or
|
Paste an element inside the timeline. element
**must** be the return of
timelineElementCopy
with deep=TRUE
,
and it should not be changed before pasting. element
itself is not
placed in the timeline, instead a new element is created, alike to the
originally copied element. Note that the originally copied element must
also lie within timeline
, at both the point of copying and pasting.
Pasting may fail if it would place the timeline in an unsupported configuration.
After calling this function element
should not be used. In particular,
element
can **not** be pasted again. Instead, you can copy the
returned element and paste that copy (although, this is only possible
if the paste was successful).
See also timelineElementPaste
.
removeLayer
:: (HasCallStack, MonadIO m, IsTimeline a, IsLayer b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
Removes a layer from the timeline.
removeTrack
:: (HasCallStack, MonadIO m, IsTimeline a, IsTrack b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
Remove a track from the timeline.
saveToUri
:: (HasCallStack, MonadIO m, IsTimeline a, IsAsset b) | |
=> a |
|
-> Text |
|
-> Maybe b |
|
-> Bool |
|
-> m () | (Can throw |
Saves the timeline to the given location. If formatterAsset
is Nothing
,
the method will attempt to save in the same format the timeline was
loaded from, before defaulting to the formatter with highest rank.
setAutoTransition
timelineSetAutoTransition Source #
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets Timeline:autoTransition for the timeline. This will also set
the corresponding Layer:autoTransition for all of the timeline's
layers to the same value. See layerSetAutoTransition
if you
wish to set the layer's Layer:autoTransition individually.
setSnappingDistance
timelineSetSnappingDistance Source #
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> Word64 |
|
-> m () |
Sets Timeline:snappingDistance for the timeline. This new value will only effect future snappings and will not be used to snap the current element positions within the timeline.
thawCommit
:: (HasCallStack, MonadIO m, IsTimeline a) | |
=> a |
|
-> m () |
Thaw the timeline so that comiting becomes possible
again and any call to commit()
that happened during the rendering is
actually taken into account.
Since: 1.20
Properties
autoTransition
Whether to automatically create a transition whenever two
Source
-s overlap in a track of the timeline. See
Layer:autoTransition if you want this to only happen in some
layers.
constructTimelineAutoTransition :: (IsTimeline 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
.
getTimelineAutoTransition :: (MonadIO m, IsTimeline o) => o -> m Bool Source #
Get the value of the “auto-transition
” property.
When overloading is enabled, this is equivalent to
get
timeline #autoTransition
setTimelineAutoTransition :: (MonadIO m, IsTimeline o) => o -> Bool -> m () Source #
Set the value of the “auto-transition
” property.
When overloading is enabled, this is equivalent to
set
timeline [ #autoTransition:=
value ]
duration
The current duration (in nanoseconds) of the timeline. A timeline
'starts' at time 0, so this is the maximum end time of all of its
TimelineElement
-s.
getTimelineDuration :: (MonadIO m, IsTimeline o) => o -> m Word64 Source #
Get the value of the “duration
” property.
When overloading is enabled, this is equivalent to
get
timeline #duration
snappingDistance
The distance (in nanoseconds) at which a TimelineElement
being
moved within the timeline should snap one of its Source
-s with
another Source
-s edge. See EditMode
for which edges can
snap during an edit. 0 means no snapping.
constructTimelineSnappingDistance :: (IsTimeline o, MonadIO m) => Word64 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “snapping-distance
” property. This is rarely needed directly, but it is used by new
.
getTimelineSnappingDistance :: (MonadIO m, IsTimeline o) => o -> m Word64 Source #
Get the value of the “snapping-distance
” property.
When overloading is enabled, this is equivalent to
get
timeline #snappingDistance
setTimelineSnappingDistance :: (MonadIO m, IsTimeline o) => o -> Word64 -> m () Source #
Set the value of the “snapping-distance
” property.
When overloading is enabled, this is equivalent to
set
timeline [ #snappingDistance:=
value ]
Signals
commited
type TimelineCommitedCallback = IO () Source #
This signal will be emitted once the changes initiated by
timelineCommit
have been executed in the backend. Use
timelineCommitSync
if you do not want to have to connect
to this signal.
afterTimelineCommited :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineCommitedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the commited signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
timeline #commited 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.
onTimelineCommited :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineCommitedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the commited signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
timeline #commited callback
groupAdded
type TimelineGroupAddedCallback Source #
Will be emitted after the group is added to to the timeline. This can
happen when grouping with ges_container_group
, or by adding
containers to a newly created group.
Note that this should not be emitted whilst a timeline is being
loaded from its Project
asset. You should connect to the
project's Project::loaded signal if you want to know which groups
were created for the timeline.
afterTimelineGroupAdded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineGroupAddedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the groupAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
timeline #groupAdded 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.
onTimelineGroupAdded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineGroupAddedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the groupAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
timeline #groupAdded callback
groupRemoved
type TimelineGroupRemovedCallback Source #
= Group |
|
-> [Container] |
|
-> IO () |
Will be emitted after the group is removed from the timeline through
ges_container_ungroup
. Note that group
will no longer contain its
former children, these are held in children
.
Note that if a group is emptied, then it will no longer belong to the timeline, but this signal will **not** be emitted in such a case.
afterTimelineGroupRemoved :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineGroupRemovedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the groupRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
timeline #groupRemoved 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.
onTimelineGroupRemoved :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineGroupRemovedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the groupRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
timeline #groupRemoved callback
layerAdded
type TimelineLayerAddedCallback Source #
Will be emitted after the layer is added to the timeline.
Note that this should not be emitted whilst a timeline is being
loaded from its Project
asset. You should connect to the
project's Project::loaded signal if you want to know which
layers were created for the timeline.
afterTimelineLayerAdded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineLayerAddedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the layerAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
timeline #layerAdded 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.
onTimelineLayerAdded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineLayerAddedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the layerAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
timeline #layerAdded callback
layerRemoved
type TimelineLayerRemovedCallback Source #
Will be emitted after the layer is removed from the timeline.
afterTimelineLayerRemoved :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineLayerRemovedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the layerRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
timeline #layerRemoved 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.
onTimelineLayerRemoved :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineLayerRemovedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the layerRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
timeline #layerRemoved callback
selectElementTrack
type TimelineSelectElementTrackCallback Source #
= Clip |
|
-> TrackElement |
|
-> IO (Maybe Track) | Returns: A track to put |
Simplified version of Timeline::selectTracksForObject which only
allows trackElement
to be added to a single Track
.
Since: 1.18
afterTimelineSelectElementTrack :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSelectElementTrackCallback) -> m SignalHandlerId Source #
Connect a signal handler for the selectElementTrack signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
timeline #selectElementTrack 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.
onTimelineSelectElementTrack :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSelectElementTrackCallback) -> m SignalHandlerId Source #
Connect a signal handler for the selectElementTrack signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
timeline #selectElementTrack callback
selectTracksForObject
type TimelineSelectTracksForObjectCallback Source #
= Clip |
|
-> TrackElement |
|
-> IO [Track] | Returns: An array of
|
This will be emitted whenever the timeline needs to determine which tracks a clip's children should be added to. The track element will be added to each of the tracks given in the return. If a track element is selected to go into multiple tracks, it will be copied into the additional tracks, under the same clip. Note that the copy will *not* keep its properties or state in sync with the original.
Connect to this signal once if you wish to control which element
should be added to which track. Doing so will overwrite the default
behaviour, which adds trackElement
to all tracks whose
Track:trackType includes the trackElement
's
TrackElement:trackType.
Note that under the default track selection, if a clip would produce
multiple core children of the same TrackType
, it will choose
one of the core children arbitrarily to place in the corresponding
tracks, with a warning for the other core children that are not
placed in the track. For example, this would happen for a UriClip
that points to a file that contains multiple audio streams. If you
wish to choose the stream, you could connect to this signal, and use,
say, uriSourceAssetGetStreamInfo
to choose which core
source to add.
When a clip is first added to a timeline, its core elements will be created for the current tracks in the timeline if they have not already been created. Then this will be emitted for each of these core children to select which tracks, if any, they should be added to. It will then be called for any non-core children in the clip.
In addition, if a new track element is ever added to a clip in a timeline (and it is not already part of a track) this will be emitted to select which tracks the element should be added to.
Finally, as a special case, if a track is added to the timeline *after* it already contains clips, then it will request the creation of the clips' core elements of the corresponding type, if they have not already been created, and this signal will be emitted for each of these newly created elements. In addition, this will also be released for all other track elements in the timeline's clips that have not yet been assigned a track. However, in this final case, the timeline will only check whether the newly added track appears in the track list. If it does appear, the track element will be added to the newly added track. All other tracks in the returned track list are ignored.
In this latter case, track elements that are already part of a track
will not be asked if they want to be copied into the new track. If
you wish to do this, you can use clipAddChildToTrack
.
Note that the returned PtrArray
should own a new reference to each
of its contained Track
. The timeline will set the DestroyNotify
free function on the PtrArray
to dereference the elements.
afterTimelineSelectTracksForObject :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSelectTracksForObjectCallback) -> m SignalHandlerId Source #
Connect a signal handler for the selectTracksForObject signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
timeline #selectTracksForObject 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.
onTimelineSelectTracksForObject :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSelectTracksForObjectCallback) -> m SignalHandlerId Source #
Connect a signal handler for the selectTracksForObject signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
timeline #selectTracksForObject callback
snappingEnded
type TimelineSnappingEndedCallback Source #
= TrackElement |
|
-> TrackElement |
|
-> Word64 |
|
-> IO () |
Will be emitted whenever a snapping event ends. After a snap event has started (see Timeline::snappingStarted), it can later end because either another timeline edit has occurred (which may or may not have created a new snapping event), or because the timeline has been committed.
afterTimelineSnappingEnded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSnappingEndedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the snappingEnded signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
timeline #snappingEnded 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.
onTimelineSnappingEnded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSnappingEndedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the snappingEnded signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
timeline #snappingEnded callback
snappingStarted
type TimelineSnappingStartedCallback Source #
= TrackElement |
|
-> TrackElement |
|
-> Word64 |
|
-> IO () |
Will be emitted whenever an element's movement invokes a snapping event during an edit (usually of one of its ancestors) because its start or end point lies within the Timeline:snappingDistance of another element's start or end point.
See EditMode
to see what can snap during an edit.
Note that only up to one snapping-started signal will be emitted per element edit within a timeline.
afterTimelineSnappingStarted :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSnappingStartedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the snappingStarted signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
timeline #snappingStarted 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.
onTimelineSnappingStarted :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineSnappingStartedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the snappingStarted signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
timeline #snappingStarted callback
trackAdded
type TimelineTrackAddedCallback Source #
Will be emitted after the track is added to the timeline.
Note that this should not be emitted whilst a timeline is being
loaded from its Project
asset. You should connect to the
project's Project::loaded signal if you want to know which
tracks were created for the timeline.
afterTimelineTrackAdded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineTrackAddedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the trackAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
timeline #trackAdded 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.
onTimelineTrackAdded :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineTrackAddedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the trackAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
timeline #trackAdded callback
trackRemoved
type TimelineTrackRemovedCallback Source #
Will be emitted after the track is removed from the timeline.
afterTimelineTrackRemoved :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineTrackRemovedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the trackRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
timeline #trackRemoved 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.
onTimelineTrackRemoved :: (IsTimeline a, MonadIO m) => a -> ((?self :: a) => TimelineTrackRemovedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the trackRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
timeline #trackRemoved callback