GES.Layer¶
- Subclasses:
None
Methods¶
- Inherited:
GObject.Object (37), GES.Extractable (3), GES.MetaContainer (40)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
whether the transitions are added |
||
r/w |
The priority of the layer |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Will be emitted whenever the layer is activated or deactivated for some |
|
Will be emitted after the clip is added to the layer. |
|
Will be emitted after the clip is removed from the layer. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
max_nle_priority |
r |
||
min_nle_priority |
r |
||
parent |
r |
||
timeline |
r |
the |
Class Details¶
- class GES.Layer(**kwargs)¶
- Bases:
GObject.InitiallyUnowned
,GES.Extractable
,GES.MetaContainer
- Abstract:
No
- Structure:
GES.Layer
-s are responsible for collecting and orderingGES.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).
GES.Timeline.move_layer
() 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.
- add_asset(asset, start, inpoint, duration, track_types)[source]¶
- Parameters:
asset (
GES.Asset
) – The asset to extract the new clip fromstart (
int
) – TheGES.TimelineElement
:start
value to set on the new clip Ifstart == #GST_CLOCK_TIME_NONE
, it will be added to the end of self, i.e. it will be set to self's durationinpoint (
int
) – TheGES.TimelineElement
:in-point
value to set on the new clipduration (
int
) – TheGES.TimelineElement
:duration
value to set on the new cliptrack_types (
GES.TrackType
) – TheGES.Clip
:supported-formats
to set on the the new clip, orGES.TrackType.UNKNOWN
to use the default
- Returns:
The newly created clip.
- Return type:
See
GES.Layer.add_asset_full
(), which also gives an error.
- add_asset_full(asset, start, inpoint, duration, track_types)[source]¶
- Parameters:
asset (
GES.Asset
) – The asset to extract the new clip fromstart (
int
) – TheGES.TimelineElement
:start
value to set on the new clip Ifstart == #GST_CLOCK_TIME_NONE
, it will be added to the end of self, i.e. it will be set to self's durationinpoint (
int
) – TheGES.TimelineElement
:in-point
value to set on the new clipduration (
int
) – TheGES.TimelineElement
:duration
value to set on the new cliptrack_types (
GES.TrackType
) – TheGES.Clip
:supported-formats
to set on the the new clip, orGES.TrackType.UNKNOWN
to use the default
- Raises:
- Returns:
The newly created clip.
- Return type:
Extracts a new clip from an asset and adds it to the layer with the given properties.
New in version 1.18.
- add_clip(clip)[source]¶
- Parameters:
clip (
GES.Clip
) – The clip to add- Returns:
True
if clip was properly added to self, orFalse
if self refused to add clip.- Return type:
See
GES.Layer.add_clip_full
(), which also gives an error.
- add_clip_full(clip)[source]¶
- Parameters:
clip (
GES.Clip
) – The clip to add- Raises:
- Returns:
True
if clip was properly added to self, orFalse
if self refused to add clip.- Return type:
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 (seeGES.TimelineElement
).New in version 1.18.
- get_active_for_track(track)[source]¶
- Parameters:
track (
GES.Track
) – TheGES.Track
to check if self is currently active for- Returns:
- Return type:
Gets whether the layer is active for the given track. See
GES.Layer.set_active_for_tracks
().New in version 1.18.
- get_auto_transition()[source]¶
-
Gets the
GES.Layer
:auto-transition
of the layer.
- get_clips()[source]¶
- Returns:
A list of clips in self.
- Return type:
[
GES.Clip
]
Get the
GES.Clip
-s contained in this layer.
- get_clips_in_interval(start, end)[source]¶
- Parameters:
- Returns:
A list of
GES.Clip
-s that intersect the interval[start, end)
in self.- Return type:
[
GES.Clip
]
Gets the clips within the layer that appear between start and end.
- get_duration()[source]¶
- Returns:
The duration of self.
- Return type:
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).
- get_priority()[source]¶
- Returns:
The priority of self within its timeline.
- Return type:
Get the priority of the layer. When inside a timeline, this is its index in the timeline. See
GES.Timeline.move_layer
().
- get_timeline()[source]¶
- Returns:
The timeline that self is currently part of, or
None
if it is not associated with any timeline.- Return type:
GES.Timeline
orNone
Gets the timeline that the layer is a part of.
- is_empty()[source]¶
-
Convenience method to check if the layer is empty (doesn’t contain any
GES.Clip
), or not.
- remove_clip(clip)[source]¶
- Parameters:
clip (
GES.Clip
) – The clip to remove- Returns:
True
if clip was removed from self, orFalse
if the operation failed.- Return type:
Removes the given clip from the layer.
- set_active_for_tracks(active, tracks)[source]¶
- Parameters:
- Returns:
- Return type:
Activate or deactivate track elements in tracks (or in all tracks if tracks is
None
).When a layer is deactivated for a track, all the
GES.TrackElement
-s in the track that belong to aGES.Clip
in the layer will no longer be active in the track, regardless of their individualGES.TrackElement
:active
value.Note that by default a layer will be active for all of its timeline’s tracks.
New in version 1.18.
- set_auto_transition(auto_transition)[source]¶
- Parameters:
auto_transition (
bool
) – Whether transitions should be automatically added to the layer
Sets
GES.Layer
:auto-transition
for the layer. UseGES.Timeline.set_auto_transition
() if you want all layers within aGES.Timeline
to haveGES.Layer
:auto-transition
set toTrue
. Use this method if you want different values for different layers (and make sure to keepGES.Timeline
:auto-transition
asFalse
for the corresponding timeline).
- set_priority(priority)[source]¶
- Parameters:
priority (
int
) – The priority to set
Sets the layer to the given priority. See
GES.Layer
:priority
.Deprecated since version 1.16.0: use
GES.Timeline.move_layer
instead. This deprecation means that you will not need to handle layer priorities at all yourself, GES will make sure there is never ‘gaps’ between layer priorities.
- set_timeline(timeline)[source]¶
- Parameters:
timeline (
GES.Timeline
) –
Signal Details¶
- GES.Layer.signals.active_changed(layer, active, tracks)¶
- Signal Name:
active-changed
- Flags:
- Parameters:
Will be emitted whenever the layer is activated or deactivated for some
GES.Track
. SeeGES.Layer.set_active_for_tracks
().New in version 1.18.
- GES.Layer.signals.clip_added(layer, clip)¶
- Signal Name:
clip-added
- Flags:
- Parameters:
Will be emitted after the clip is added to the layer.
Property Details¶
- GES.Layer.props.auto_transition¶
-
Whether to automatically create a
GES.TransitionClip
whenever twoGES.Source
-s that both belong to aGES.Clip
in the layer overlap. SeeGES.Timeline
for what counts as an overlap.When a layer is added to a
GES.Timeline
, if this property is left asFalse
, but the timeline’sGES.Timeline
:auto-transition
isTrue
, it will be set toTrue
as well.
- GES.Layer.props.priority¶
-
The priority of the layer in the
GES.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 givenGES.Timeline
.Note that the timeline needs to be committed (with
GES.Timeline.commit
) for the change to be taken into account.Deprecated since version 1.16.0: use
GES.Timeline.move_layer
instead. This deprecation means that you will not need to handle layer priorities at all yourself, GES will make sure there is never ‘gaps’ between layer priorities.