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.Clip

Description

Clip-s are the core objects of a Layer. Each clip may exist in a single layer but may control several TrackElement-s that span several Track-s. A clip will ensure that all its children share the same TimelineElement:start and TimelineElement:duration in their tracks, which will match the TimelineElement:start and TimelineElement:duration of the clip itself. Therefore, changing the timing of the clip will change the timing of the children, and a change in the timing of a child will change the timing of the clip and subsequently all its siblings. As such, a clip can be treated as a singular object in its layer.

For most uses of a Timeline, it is often sufficient to only interact with Clip-s directly, which will take care of creating and organising the elements of the timeline's tracks.

Core Children

In more detail, clips will usually have some *core* TrackElement children, which are created by the clip when it is added to a layer in a timeline. The type and form of these core children will depend on the clip's subclass. You can use trackElementIsCore to determine whether a track element is considered such a core track element. Note, if a core track element is part of a clip, it will always be treated as a core *child* of the clip. You can connect to the Container::childAdded signal to be notified of their creation.

When a child is added to a clip, the timeline will select its tracks using Timeline::selectTracksForObject. Note that it may be the case that the child will still have no set TrackElement:track after this process. For example, if the timeline does not have a track of the corresponding Track:trackType. A clip can safely contain such children, which may have their track set later, although they will play no functioning role in the timeline in the meantime.

If a clip may create track elements with various TrackElement:trackType(s), such as a UriClip, but you only want it to create a subset of these types, you should set the Clip:supportedFormats of the clip to the subset of types. This should be done *before* adding the clip to a layer.

If a clip will produce several core elements of the same TrackElement:trackType, you should connect to the timeline's Timeline::selectTracksForObject signal to coordinate which tracks each element should land in. Note, no two core children within a clip can share the same Track, so you should not select the same track for two separate core children. Provided you stick to this rule, it is still safe to select several tracks for the same core child, the core child will be copied into the additional tracks. You can manually add the child to more tracks later using clipAddChildToTrack. If you do not wish to use a core child, you can always select no track.

The TimelineElement:inPoint of the clip will control the TimelineElement:inPoint of its core children to be the same value if their TrackElement:hasInternalSource is set to True.

The TimelineElement:maxDuration of the clip is the minimum TimelineElement:maxDuration of its core children. If you set its value to anything other than its current value, this will also set the TimelineElement:maxDuration of all its core children to the same value if their TrackElement:hasInternalSource is set to True. As a special case, whilst a clip does not yet have any core children, its TimelineElement:maxDuration may be set to indicate what its value will be once they are created.

Effects

Some subclasses (tSourceClip and BaseEffectClip) may also allow their objects to have additional non-core BaseEffect-s elements as children. These are additional effects that are applied to the output data of the core elements. They can be added to the clip using clipAddTopEffect, which will take care of adding the effect to the timeline's tracks. The new effect will be placed between the clip's core track elements and its other effects. As such, the newly added effect will be applied to any source data **before** the other existing effects. You can change the ordering of effects using clipSetTopEffectIndex.

Tracks are selected for top effects in the same way as core children. If you add a top effect to a clip before it is part of a timeline, and later add the clip to a timeline, the track selection for the top effects will occur just after the track selection for the core children. If you add a top effect to a clip that is already part of a timeline, the track selection will occur immediately. Since a top effect must be applied on top of a core child, if you use Timeline::selectTracksForObject, you should ensure that the added effects are destined for a Track that already contains a core child.

In addition, if the core child in the track is not TrackElement:active, then neither can any of its effects be TrackElement:active. Therefore, if a core child is made in-active, all of the additional effects in the same track will also become in-active. Similarly, if an effect is set to be active, then the core child will also become active, but other effects will be left alone. Finally, if an active effect is added to the track of an in-active core child, it will become in-active as well. Note, in contrast, setting a core child to be active, or an effect to be in-active will *not* change the other children in the same track.

Time Effects

Some effects also change the timing of their data (see BaseEffect for what counts as a time effect). Note that a BaseEffectClip will refuse time effects, but a Source will allow them.

When added to a clip, time effects may adjust the timing of other children in the same track. Similarly, when changing the order of effects, making them (in)-active, setting their time property values or removing time effects. These can cause the Clip:durationLimit to change in value. However, if such an operation would ever cause the TimelineElement:duration to shrink such that a clip's Source is totally overlapped in the timeline, the operation would be prevented. Note that the same can happen when adding non-time effects with a finite TimelineElement:maxDuration.

Therefore, when working with time effects, you should -- more so than usual -- not assume that setting the properties of the clip's children will succeed. In particular, you should use timelineElementSetChildPropertyFull when setting the time properties.

If you wish to preserve the *internal* duration of a source in a clip during these time effect operations, you can do something like the following.

c code

void
do_time_effect_change (GESClip * clip)
{
  GList *tmp, *children;
  GESTrackElement *source;
  GstClockTime source_outpoint;
  GstClockTime new_end;
  GError *error = NULL;

  // choose some active source in a track to preserve the internal
  // duration of
  source = ges_clip_get_track_element (clip, NULL, GES_TYPE_SOURCE);

  // note its current internal end time
  source_outpoint = ges_clip_get_internal_time_from_timeline_time (
        clip, source, GES_TIMELINE_ELEMENT_END (clip), NULL);

  // handle invalid out-point

  // stop the children's control sources from clamping when their
  // out-point changes with a change in the time effects
  children = ges_container_get_children (GES_CONTAINER (clip), FALSE);

  for (tmp = children; tmp; tmp = tmp->next)
    ges_track_element_set_auto_clamp_control_source (tmp->data, FALSE);

  // add time effect, or set their children properties, or move them around
  ...
  // user can make sure that if a time effect changes one source, we should
  // also change the time effect for another source. E.g. if
  // "GstVideorate::rate" is set to 2.0, we also set "GstPitch::rate" to
  // 2.0

  // Note the duration of the clip may have already changed if the
  // duration-limit of the clip dropped below its current value

  new_end = ges_clip_get_timeline_time_from_internal_time (
        clip, source, source_outpoint, &error);
  // handle error

  if (!ges_timeline_elemnet_edit_full (GES_TIMELINE_ELEMENT (clip),
        -1, GES_EDIT_MODE_TRIM, GES_EDGE_END, new_end, &error))
    // handle error

  for (tmp = children; tmp; tmp = tmp->next)
    ges_track_element_set_auto_clamp_control_source (tmp->data, TRUE);

  g_list_free_full (children, gst_object_unref);
  gst_object_unref (source);
}
Synopsis

Exported types

newtype Clip Source #

Memory-managed wrapper type.

Constructors

Clip (ManagedPtr Clip) 

Instances

Instances details
Eq Clip Source # 
Instance details

Defined in GI.GES.Objects.Clip

Methods

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

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

GObject Clip Source # 
Instance details

Defined in GI.GES.Objects.Clip

ManagedPtrNewtype Clip Source # 
Instance details

Defined in GI.GES.Objects.Clip

Methods

toManagedPtr :: Clip -> ManagedPtr Clip

TypedObject Clip Source # 
Instance details

Defined in GI.GES.Objects.Clip

Methods

glibType :: IO GType

HasParentTypes Clip Source # 
Instance details

Defined in GI.GES.Objects.Clip

IsGValue (Maybe Clip) Source #

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

Instance details

Defined in GI.GES.Objects.Clip

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes Clip Source # 
Instance details

Defined in GI.GES.Objects.Clip

type ParentTypes Clip = '[Container, TimelineElement, Object, Extractable, MetaContainer]

class (GObject o, IsDescendantOf Clip o) => IsClip o Source #

Type class for types which can be safely cast to Clip, for instance with toClip.

Instances

Instances details
(GObject o, IsDescendantOf Clip o) => IsClip o Source # 
Instance details

Defined in GI.GES.Objects.Clip

toClip :: (MonadIO m, IsClip o) => o -> m Clip Source #

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

Methods

Click to display all available methods, including inherited ones

Expand

Methods

add, addAsset, addChildProperty, addChildToTrack, addMetasFromString, addTopEffect, bindProperty, bindPropertyFull, checkMetaRegistered, copy, edit, editFull, findTrackElement, findTrackElements, forceFloating, foreach, freezeNotify, getv, isFloating, listChildrenProperties, lookupChild, metasToString, moveToLayer, moveToLayerFull, notify, notifyByPspec, paste, ref, refSink, registerMeta, registerMetaBoolean, registerMetaDate, registerMetaDateTime, registerMetaDouble, registerMetaFloat, registerMetaInt, registerMetaInt64, registerMetaString, registerMetaUint, registerMetaUint64, registerStaticMeta, remove, removeChildProperty, removeTopEffect, ripple, rippleEnd, rollEnd, rollStart, runDispose, split, splitFull, stealData, stealQdata, thawNotify, trim, ungroup, unref, watchClosure.

Getters

getAsset, getBoolean, getChildProperty, getChildPropertyByPspec, getChildren, getData, getDate, getDateTime, getDouble, getDuration, getDurationLimit, getFloat, getId, getInpoint, getInt, getInt64, getInternalTimeFromTimelineTime, getLayer, getLayerPriority, getMarkerList, getMaxDuration, getMeta, getName, getNaturalFramerate, getParent, getPriority, getProperty, getQdata, getStart, getString, getSupportedFormats, getTimeline, getTimelineTimeFromInternalTime, getTimelineTimeFromSourceFrame, getTopEffectIndex, getTopEffectPosition, getTopEffects, getToplevelParent, getTrackTypes, getUint, getUint64.

Setters

setAsset, setBoolean, setChildProperty, setChildPropertyByPspec, setChildPropertyFull, setData, setDataFull, setDate, setDateTime, setDouble, setDuration, setFloat, setInpoint, setInt, setInt64, setMarkerList, setMaxDuration, setMeta, setName, setParent, setPriority, setProperty, setStart, setString, setSupportedFormats, setTimeline, setTopEffectIndex, setTopEffectIndexFull, setTopEffectPriority, setUint, setUint64.

addAsset

clipAddAsset Source #

Arguments

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

clip: A Clip

-> b

asset: An asset with GES_TYPE_TRACK_ELEMENT as its Asset:extractableType

-> m (Maybe TrackElement)

Returns: The newly created element, or Nothing if an error occurred.

Extracts a TrackElement from an asset and adds it to the clip. This can be used to add effects that derive from the asset to the clip, but this method is not intended to be used to create the core elements of the clip.

addChildToTrack

clipAddChildToTrack Source #

Arguments

:: (HasCallStack, MonadIO m, IsClip a, IsTrackElement b, IsTrack c) 
=> a

clip: A Clip

-> b

child: A child of clip

-> c

track: The track to add child to

-> m TrackElement

Returns: The element that was added to track, either child or a copy of child, or Nothing if the element could not be added. (Can throw GError)

Adds the track element child of the clip to a specific track.

If the given child is already in another track, this will create a copy of the child, add it to the clip, and add this copy to the track.

You should only call this whilst a clip is part of a Timeline, and for tracks that are in the same timeline.

This method is an alternative to using the Timeline::selectTracksForObject signal, but can be used to complement it when, say, you wish to copy a clip's children from one track into a new one.

When the child is a core child, it must be added to a track that does not already contain another core child of the same clip. If it is not a core child (an additional effect), then it must be added to a track that already contains one of the core children of the same clip.

This method can also fail if the adding the track element to the track would break a configuration rule of the corresponding Timeline, such as causing three sources to overlap at a single time, or causing a source to completely overlap another in the same track.

Since: 1.18

addTopEffect

clipAddTopEffect Source #

Arguments

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

clip: A Clip

-> b

effect: A top effect to add

-> Int32

index: The index to add effect at, or -1 to add at the highest

-> m ()

(Can throw GError)

Add a top effect to a clip at the given index.

Unlike using containerAdd, this allows you to set the index in advance. It will also check that no error occurred during the track selection for the effect.

Note, only subclasses of ClipClass that have GES_CLIP_CLASS_CAN_ADD_EFFECTS set to True (such as SourceClip and BaseEffectClip) can have additional top effects added.

Note, if the effect is a time effect, this may be refused if the clip would not be able to adapt itself once the effect is added.

Since: 1.18

findTrackElement

clipFindTrackElement Source #

Arguments

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

clip: A Clip

-> Maybe b

track: The track to search in, or Nothing to search in all tracks

-> GType

type: The type of track element to search for, or G_TYPE_NONE to match any type

-> m (Maybe TrackElement)

Returns: The element controlled by clip, in track, and of the given type, or Nothing if no such element could be found.

Finds an element controlled by the clip. If track is given, then only the track elements in track are searched for. If type is given, then this function searches for a track element of the given type.

Note, if multiple track elements in the clip match the given criteria, this will return the element amongst them with the highest TimelineElement:priority (numerically, the smallest). See clipFindTrackElements if you wish to find all such elements.

findTrackElements

clipFindTrackElements Source #

Arguments

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

clip: A Clip

-> Maybe b

track: The track to search in, or Nothing to search in all tracks

-> [TrackType]

trackType: The track-type of the track element to search for, or GES_TRACK_TYPE_UNKNOWN to match any track type

-> GType

type: The type of track element to search for, or G_TYPE_NONE to match any type

-> m [TrackElement]

Returns: A list of all the TrackElement-s controlled by clip, in track or of the given trackType, and of the given type.

Finds the TrackElement-s controlled by the clip that match the given criteria. If track is given as Nothing and trackType is given as GES_TRACK_TYPE_UNKNOWN, then the search will match all elements in any track, including those with no track, and of any TrackElement:trackType. Otherwise, if track is not Nothing, but trackType is GES_TRACK_TYPE_UNKNOWN, then only the track elements in track are searched for. Otherwise, if trackType is not GES_TRACK_TYPE_UNKNOWN, but track is Nothing, then only the track elements whose TrackElement:trackType matches trackType are searched for. Otherwise, when both are given, the track elements that match **either** criteria are searched for. Therefore, if you wish to only find elements in a specific track, you should give the track as track, but you should not give the track's Track:trackType as trackType because this would also select elements from other tracks of the same type.

You may also give type to _further_ restrict the search to track elements of the given type.

getDurationLimit

clipGetDurationLimit Source #

Arguments

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

clip: A Clip

-> m Word64

Returns: The duration-limit of clip.

Gets the Clip:durationLimit of the clip.

Since: 1.18

getInternalTimeFromTimelineTime

clipGetInternalTimeFromTimelineTime Source #

Arguments

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

clip: A Clip

-> b

child: An TrackElement:active child of clip with a TrackElement:track

-> Word64

timelineTime: A time in the timeline time coordinates

-> m Word64

Returns: The time in the internal coordinates of child corresponding to timelineTime, or CLOCK_TIME_NONE if the conversion could not be performed. (Can throw GError)

Convert the timeline time to an internal source time of the child. This will take any time effects placed on the clip into account (see BaseEffect for what time effects are supported, and how to declare them in GES).

When timelineTime is above the TimelineElement:start of clip, this will return the internal time at which the content that appears at timelineTime in the output of the timeline is created in child. For example, if timelineTime corresponds to the current seek position, this would let you know which part of a media file is being read.

This will be done assuming the clip has an indefinite end, so the internal time may be beyond the current out-point of the child, or even its TimelineElement:maxDuration.

If, instead, timelineTime is below the current TimelineElement:start of clip, this will return what you would need to set the TimelineElement:inPoint of child to if you set the TimelineElement:start of clip to timelineTime and wanted to keep the content of child currently found at the current TimelineElement:start of clip at the same timeline position. If this would be negative, the conversion fails. This is useful for determining what TimelineElement:inPoint would result from a GES_EDIT_MODE_TRIM to timelineTime.

Note that whilst a clip has no time effects, this second return is equivalent to finding the internal time at which the content that appears at timelineTime in the timeline can be found in child if it had indefinite extent in both directions. However, with non-linear time effects this second return will be more distinct.

In either case, the returned time would be appropriate to use for the TimelineElement:inPoint or TimelineElement:maxDuration of the child.

See clipGetTimelineTimeFromInternalTime, which performs the reverse.

Since: 1.18

getLayer

clipGetLayer Source #

Arguments

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

clip: A Clip

-> m (Maybe Layer)

Returns: The layer clip is in, or Nothing if clip is not in any layer.

Gets the Clip:layer of the clip.

getSupportedFormats

clipGetSupportedFormats Source #

Arguments

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

clip: A Clip

-> m [TrackType]

Returns: The TrackType-s supported by clip.

Gets the Clip:supportedFormats of the clip.

getTimelineTimeFromInternalTime

clipGetTimelineTimeFromInternalTime Source #

Arguments

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

clip: A Clip

-> b

child: An TrackElement:active child of clip with a TrackElement:track

-> Word64

internalTime: A time in the internal time coordinates of child

-> m Word64

Returns: The time in the timeline coordinates corresponding to internalTime, or CLOCK_TIME_NONE if the conversion could not be performed. (Can throw GError)

Convert the internal source time from the child to a timeline time. This will take any time effects placed on the clip into account (see BaseEffect for what time effects are supported, and how to declare them in GES).

When internalTime is above the TimelineElement:inPoint of child, this will return the timeline time at which the internal content found at internalTime appears in the output of the timeline's track. For example, this would let you know where in the timeline a particular scene in a media file would appear.

This will be done assuming the clip has an indefinite end, so the timeline time may be beyond the end of the clip, or even breaking its Clip:durationLimit.

If, instead, internalTime is below the current TimelineElement:inPoint of child, this will return what you would need to set the TimelineElement:start of clip to if you set the TimelineElement:inPoint of child to internalTime and wanted to keep the content of child currently found at the current TimelineElement:start of clip at the same timeline position. If this would be negative, the conversion fails. This is useful for determining what position to use in a GES_EDIT_MODE_TRIM if you wish to trim to a specific point in the internal content, such as a particular scene in a media file.

Note that whilst a clip has no time effects, this second return is equivalent to finding the timeline time at which the content of child at internalTime would be found in the timeline if it had indefinite extent in both directions. However, with non-linear time effects this second return will be more distinct.

In either case, the returned time would be appropriate to use in timelineElementEdit for GES_EDIT_MODE_TRIM, and similar, if you wish to use a particular internal point as a reference. For example, you could choose to end a clip at a certain internal 'out-point', similar to the TimelineElement:inPoint, by translating the desired end time into the timeline coordinates, and using this position to trim the end of a clip.

See clipGetInternalTimeFromTimelineTime, which performs the reverse, or clipGetTimelineTimeFromSourceFrame which does the same conversion, but using frame numbers.

Since: 1.18

getTimelineTimeFromSourceFrame

clipGetTimelineTimeFromSourceFrame Source #

Arguments

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

clip: A Clip

-> Int64

frameNumber: The frame number to get the corresponding timestamp of in the timeline coordinates

-> m Word64

Returns: The timestamp corresponding to frameNumber in the core children of clip, in the timeline coordinates, or CLOCK_TIME_NONE if the conversion could not be performed. (Can throw GError)

Convert the source frame number to a timeline time. This acts the same as clipGetTimelineTimeFromInternalTime using the core children of the clip and using the frame number to specify the internal position, rather than a timestamp.

The returned timeline time can be used to seek or edit to a specific frame.

Note that you can get the frame timestamp of a particular clip asset with clipAssetGetFrameTime.

Since: 1.18

getTopEffectIndex

clipGetTopEffectIndex Source #

Arguments

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

clip: A Clip

-> b

effect: The effect we want to get the index of

-> m Int32

Returns: The index of effect in clip, or -1 if something went wrong.

Gets the internal index of an effect in the clip. The index of effects in a clip will run from 0 to n-1, where n is the total number of effects. If two effects share the same TrackElement:track, the effect with the numerically lower index will be applied to the source data **after** the other effect, i.e. output data will always flow from a higher index effect to a lower index effect.

getTopEffectPosition

clipGetTopEffectPosition :: (HasCallStack, MonadIO m, IsClip a, IsBaseEffect b) => a -> b -> m Int32 Source #

No description available in the introspection data.

getTopEffects

clipGetTopEffects Source #

Arguments

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

clip: A Clip

-> m [TrackElement]

Returns: A list of all BaseEffect-s that have been added to clip.

Gets the BaseEffect-s that have been added to the clip. The returned list is ordered by their internal index in the clip. See clipGetTopEffectIndex.

moveToLayer

clipMoveToLayer Source #

Arguments

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

clip: A Clip

-> b

layer: The new layer

-> m Bool

Returns: True if clip was successfully moved to layer.

See clipMoveToLayerFull, which also gives an error.

moveToLayerFull

clipMoveToLayerFull Source #

Arguments

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

clip: A Clip

-> b

layer: The new layer

-> m ()

(Can throw GError)

Moves a clip to a new layer. If the clip already exists in a layer, it is first removed from its current layer before being added to the new layer.

Since: 1.18

removeTopEffect

clipRemoveTopEffect Source #

Arguments

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

clip: A Clip

-> b

effect: The top effect to remove

-> m ()

(Can throw GError)

Remove a top effect from the clip.

Note, if the effect is a time effect, this may be refused if the clip would not be able to adapt itself once the effect is removed.

Since: 1.18

setSupportedFormats

clipSetSupportedFormats Source #

Arguments

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

clip: A Clip

-> [TrackType]

supportedformats: The TrackType-s supported by clip

-> m () 

Sets the Clip:supportedFormats of the clip. This should normally only be called by subclasses, which should be responsible for updating its value, rather than the user.

setTopEffectIndex

clipSetTopEffectIndex Source #

Arguments

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

clip: A Clip

-> b

effect: An effect within clip to move

-> Word32

newindex: The index for effect in clip

-> m Bool

Returns: True if effect was successfully moved to newindex.

See clipSetTopEffectIndexFull, which also gives an error.

setTopEffectIndexFull

clipSetTopEffectIndexFull Source #

Arguments

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

clip: A Clip

-> b

effect: An effect within clip to move

-> Word32

newindex: The index for effect in clip

-> m ()

(Can throw GError)

Set the index of an effect within the clip. See clipGetTopEffectIndex. The new index must be an existing index of the clip. The effect is moved to the new index, and the other effects may be shifted in index accordingly to otherwise maintain the ordering.

Since: 1.18

setTopEffectPriority

clipSetTopEffectPriority :: (HasCallStack, MonadIO m, IsClip a, IsBaseEffect b) => a -> b -> Word32 -> m Bool Source #

No description available in the introspection data.

split

clipSplit Source #

Arguments

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

clip: The Clip to split

-> Word64

position: The timeline position at which to perform the split

-> m (Maybe Clip)

Returns: The newly created clip resulting from the splitting clip, or Nothing if clip can't be split.

See clipSplitFull, which also gives an error.

splitFull

clipSplitFull Source #

Arguments

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

clip: The Clip to split

-> Word64

position: The timeline position at which to perform the split, between the start and end of the clip

-> m (Maybe Clip)

Returns: The newly created clip resulting from the splitting clip, or Nothing if clip can't be split. (Can throw GError)

Splits a clip at the given timeline position into two clips. The clip must already have a Clip:layer.

The original clip's TimelineElement:duration is reduced such that its end point matches the split position. Then a new clip is created in the same layer, whose TimelineElement:start matches the split position and TimelineElement:duration will be set such that its end point matches the old end point of the original clip. Thus, the two clips together will occupy the same positions in the timeline as the original clip did.

The children of the new clip will be new copies of the original clip's children, so it will share the same sources and use the same operations.

The new clip will also have its TimelineElement:inPoint set so that any internal data will appear in the timeline at the same time. Thus, when the timeline is played, the playback of data should appear the same. This may be complicated by any additional Effect-s that have been placed on the original clip that depend on the playback time or change the data consumption rate of sources. This method will attempt to translate these effects such that the playback appears the same. In such complex situations, you may get a better result if you place the clip in a separate sub Project, which only contains this clip (and its effects), and in the original layer create two neighbouring UriClip-s that reference this sub-project, but at a different TimelineElement:inPoint.

Since: 1.18

Properties

durationLimit

The maximum TimelineElement:duration that can be *currently* set for the clip, taking into account the TimelineElement:inPoint, TimelineElement:maxDuration, TrackElement:active, and TrackElement:track properties of its children, as well as any time effects. If there is no limit, this will be set to CLOCK_TIME_NONE.

Note that whilst a clip has no children in any tracks, the limit will be unknown, and similarly set to CLOCK_TIME_NONE.

If the duration-limit would ever go below the current TimelineElement:duration of the clip due to a change in the above variables, its TimelineElement:duration will be set to the new limit.

Since: 1.18

getClipDurationLimit :: (MonadIO m, IsClip o) => o -> m Word64 Source #

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

get clip #durationLimit

layer

The layer this clip lies in.

If you want to connect to this property's Object::notify signal, you should connect to it with g_signal_connect_after() since the signal emission may be stopped internally.

getClipLayer :: (MonadIO m, IsClip o) => o -> m (Maybe Layer) Source #

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

get clip #layer

supportedFormats

The TrackType-s that the clip supports, which it can create TrackElement-s for. Note that this can be a combination of TrackType flags to indicate support for several TrackElement:trackType elements.

constructClipSupportedFormats :: (IsClip o, MonadIO m) => [TrackType] -> m (GValueConstruct o) Source #

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

getClipSupportedFormats :: (MonadIO m, IsClip o) => o -> m [TrackType] Source #

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

get clip #supportedFormats

setClipSupportedFormats :: (MonadIO m, IsClip o) => o -> [TrackType] -> m () Source #

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

set clip [ #supportedFormats := value ]