GES.Layer

g GObject.InitiallyUnowned GObject.InitiallyUnowned GES.Layer GES.Layer GObject.InitiallyUnowned->GES.Layer GES.MetaContainer GES.MetaContainer GES.MetaContainer->GES.Layer GObject.GInterface GObject.GInterface GObject.GInterface->GES.MetaContainer GES.Extractable GES.Extractable GObject.GInterface->GES.Extractable GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned GES.Extractable->GES.Layer

Subclasses:None

Methods

Inherited:GObject.Object (40), GES.Extractable (3), GES.MetaContainer (37)
Structs:GObject.ObjectClass (5)
class new ()
  add_asset (asset, start, inpoint, duration, track_types)
  add_clip (clip)
  get_auto_transition ()
  get_clips ()
  get_clips_in_interval (start, end)
  get_duration ()
  get_priority ()
  get_timeline ()
  is_empty ()
  remove_clip (clip)
  set_auto_transition (auto_transition)
  set_priority (priority)
  set_timeline (timeline)

Virtual Methods

Inherited:GObject.Object (7), GES.Extractable (3)
  do_object_added (object)
  do_object_removed (object)

Properties

Name Type Flags Short Description
auto-transition bool r/w whether the transitions are added
priority int r/w The priority of the layer

Signals

Inherited:GObject.Object (1), GES.MetaContainer (1)
Name Short Description
clip-added Will be emitted after the clip was added to the layer.
clip-removed Will be emitted after the clip was removed from the layer.

Fields

Inherited:GObject.Object (1), GES.MetaContainer (1)
Name Type Access Description
max_nle_priority int r  
min_nle_priority int r  
parent GObject.InitiallyUnowned r  
timeline GES.Timeline r the GES.Timeline where this layer is being used.

Class Details

class GES.Layer(**kwargs)
Bases:GObject.InitiallyUnowned, GES.Extractable, GES.MetaContainer
Abstract:No
Structure:GES.LayerClass

Responsible for the ordering of the various contained Clip(s). A timeline layer has a “priority” property, which is used to manage the priorities of individual Clips. Two layers should not have the same priority within a given timeline.

classmethod new()[source]
Returns:A new GES.Layer
Return type:GES.Layer

Creates a new GES.Layer.

add_asset(asset, start, inpoint, duration, track_types)[source]
Parameters:
Returns:

Created GES.Clip

Return type:

GES.Clip

Creates Clip from asset, adds it to layer and returns a reference to it.

add_clip(clip)[source]
Parameters:clip (GES.Clip) – the GES.Clip to add.
Returns:True if the clip was properly added to the layer, or False if the self refuses to add the clip.
Return type:bool

Adds the given clip to the layer. Sets the clip’s parent, and thus takes ownership of the clip.

An clip can only be added to one layer.

Calling this method will construct and properly set all the media related elements on clip. If you need to know when those objects (actually GES.TrackElement) are constructed, you should connect to the container::child-added signal which is emited right after those elements are ready to be used.

get_auto_transition()[source]
Returns:True if transitions are automatically added, else False.
Return type:bool

Gets whether transitions are automatically added when objects overlap or not.

get_clips()[source]
Returns:a GLib.List of clips. The user is responsible for unreffing the contained objects and freeing the list.
Return type:[GES.Clip]

Get the clips this layer contains.

get_clips_in_interval(start, end)[source]
Parameters:
  • start (int) – start of the interval
  • end (int) – end of the interval
Returns:

a GLib.List of clips intersecting [start, end) interval on self.

Return type:

[GES.Clip]

Gets the clips which appear between start and end on self.

get_duration()[source]
Returns:The duration of a layer
Return type:int

Lets you retrieve the duration of the layer, which means the end time of the last clip inside it

get_priority()[source]
Returns:The priority of the self within the timeline.
Return type:int

Get the priority of self within the timeline.

get_timeline()[source]
Returns:the GES.Timeline in which GES.Layer currently is or None if not in any timeline yet.
Return type:GES.Timeline or None

Get the GES.Timeline in which GES.Layer currently is.

is_empty()[source]
Returns:True if self is empty, False if it already contains at least one GES.Clip
Return type:bool

Convenience method to check if self is empty (doesn’t contain any clip), or not.

remove_clip(clip)[source]
Parameters:clip (GES.Clip) – the GES.Clip to remove
Returns:True if the clip could be removed, False if the layer does not want to remove the clip.
Return type:bool

Removes the given clip from the self and unparents it. Unparenting it means the reference owned by self on the clip will be removed. If you wish to use the clip after this function, make sure you call Gst.Object.ref() before removing it from the self.

set_auto_transition(auto_transition)[source]
Parameters:auto_transition (bool) – whether the auto_transition is active

Sets the layer to the given auto_transition. See the documentation of the property auto_transition for more information.

set_priority(priority)[source]
Parameters:priority (int) – the priority to set

Sets the layer to the given priority. See the documentation of the priority property for more information.

set_timeline(timeline)[source]
Parameters:timeline (GES.Timeline) –
do_object_added(object) virtual
Parameters:object (GES.Clip) –
do_object_removed(object) virtual
Parameters:object (GES.Clip) –

Signal Details

GES.Layer.signals.clip_added(layer, clip)
Signal Name:

clip-added

Flags:

RUN_FIRST

Parameters:

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

GES.Layer.signals.clip_removed(layer, clip)
Signal Name:

clip-removed

Flags:

RUN_FIRST

Parameters:

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

Property Details

GES.Layer.props.auto_transition
Name:auto-transition
Type:bool
Default Value:False
Flags:READABLE, WRITABLE

Sets whether transitions are added automagically when clips overlap.

GES.Layer.props.priority
Name:priority
Type:int
Default Value:0
Flags:READABLE, WRITABLE

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

Note that the timeline needs to be commited (with GES.Timeline.commit) for the change to be taken into account.