GES.Container

g GES.Container GES.Container GES.Extractable GES.Extractable GES.TimelineElement GES.TimelineElement GES.Extractable->GES.TimelineElement GES.MetaContainer GES.MetaContainer GES.MetaContainer->GES.TimelineElement GES.TimelineElement->GES.Container GObject.GInterface GObject.GInterface GObject.GInterface->GES.Extractable GObject.GInterface->GES.MetaContainer GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->GES.TimelineElement GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned

Subclasses:GES.Clip, GES.Group

Methods

Inherited:GES.TimelineElement (38), GObject.Object (37), GES.Extractable (3), GES.MetaContainer (40)
Structs:GObject.ObjectClass (5)
class group (containers)
  add (child)
  edit (layers, new_layer_priority, mode, edge, position)
  get_children (recursive)
  remove (child)
  ungroup (recursive)

Virtual Methods

Inherited:GES.TimelineElement (18), GObject.Object (7), GES.Extractable (3)
  do_add_child (element)
  do_child_added (element)
  do_child_removed (element)
  do_edit (layers, new_layer_priority, mode, edge, position)
  do_remove_child (element)
  do_ungroup (recursive)

Properties

Inherited:GES.TimelineElement (9)
Name Type Flags Short Description
height int r The span of priorities this container occupies

Signals

Inherited:GES.TimelineElement (3), GObject.Object (1), GES.MetaContainer (1)
Name Short Description
child-added Will be emitted after a child is added to the container.
child-removed Will be emitted after a child is removed from the container.

Fields

Inherited:GES.TimelineElement (3), GObject.Object (1), GES.MetaContainer (1)
Name Type Access Description
children [GES.TimelineElement] r The list of GES.TimelineElement-s controlled by this Container
children_control_mode GES.ChildrenControlMode r  
height int r The GES.Container :height of obj
initiated_move GES.TimelineElement r  
parent GES.TimelineElement r  

Class Details

class GES.Container(**kwargs)
Bases:GES.TimelineElement
Abstract:Yes
Structure:GES.ContainerClass

A GES.Container is a timeline element that controls other GES.TimelineElement-s, which are its children. In particular, it is responsible for maintaining the relative GES.TimelineElement :start and GES.TimelineElement :duration times of its children. Therefore, if a container is temporally adjusted or moved to a new layer, it may accordingly adjust and move its children. Similarly, a change in one of its children may prompt the parent to correspondingly change its siblings.

classmethod group(containers)[source]
Parameters:containers ([GES.Container] or None) – The GES.Container-s to group
Returns:The container created by merging containers, or None if they could not be merged into a single container.
Return type:GES.Container

Groups the containers into a single container by merging them. The containers must all belong to the same GES.TimelineElement :timeline.

If the elements are all GES.Clip-s then this method will attempt to combine them all into a single GES.Clip. This should succeed if they: share the same GES.TimelineElement :start, GES.TimelineElement :duration and GES.TimelineElement :in-point; exist in the same layer; and all of the sources share the same GES.Asset. If this fails, or one of the elements is not a GES.Clip, this method will try to create a GES.Group instead.

add(child)[source]
Parameters:child (GES.TimelineElement) – The element to add as a child
Returns:True if child was successfully added to self.
Return type:bool

Adds a timeline element to the container. The element will now be a child of the container (and the container will be the GES.TimelineElement :parent of the added element), which means that it is now controlled by the container. This may change the properties of the child or the container, depending on the subclass.

Additionally, the children properties of the newly added element will be shared with the container, meaning they can also be read and set using GES.TimelineElement.get_child_property() and GES.TimelineElement.set_child_property() on the container.

edit(layers, new_layer_priority, mode, edge, position)[source]
Parameters:
  • layers ([GES.Layer] or None) – A whitelist of layers where the edit can be performed, None allows all layers in the timeline
  • new_layer_priority (int) – The priority/index of the layer self should be moved to. -1 means no move
  • mode (GES.EditMode) – The edit mode
  • edge (GES.Edge) – The edge of self where the edit should occur
  • position (int) – The edit position: a new location for the edge of self (in nanoseconds)
Returns:

True if the edit of self completed, False on failure.

Return type:

bool

Edits the container within its timeline.

Deprecated since version 1.18: use GES.TimelineElement.edit instead.

get_children(recursive)[source]
Parameters:recursive (bool) – Whether to recursively get children in self
Returns:The list of GES.TimelineElement-s contained in self.
Return type:[GES.TimelineElement]

Get the list of timeline elements contained in the container. If recursive is True, and the container contains other containers as children, then their children will be added to the list, in addition to themselves, and so on.

remove(child)[source]
Parameters:child (GES.TimelineElement) – The child to remove
Returns:True if child was successfully removed from self.
Return type:bool

Removes a timeline element from the container. The element will no longer be controlled by the container.

ungroup(recursive)[source]
Parameters:recursive (bool) – Whether to recursively ungroup self
Returns:The list of new GES.Container-s created from the splitting of self.
Return type:[GES.Container]

Ungroups the container by splitting it into several containers containing various children of the original. The rules for how the container splits depends on the subclass. A GES.Group will simply split into its children. A GES.Clip will split into one GES.Clip per GES.TrackType it overlaps with (so an audio-video clip will split into an audio clip and a video clip), where each clip contains all the GES.TrackElement-s from the original clip with a matching GES.TrackElement :track-type.

If recursive is True, and the container contains other containers as children, then they will also be ungrouped, and so on.

do_add_child(element) virtual
Parameters:element (GES.TimelineElement) –
Return type:bool
do_child_added(element) virtual
Parameters:element (GES.TimelineElement) –
do_child_removed(element) virtual
Parameters:element (GES.TimelineElement) –
do_edit(layers, new_layer_priority, mode, edge, position) virtual
Parameters:
  • layers ([GES.Layer] or None) – A whitelist of layers where the edit can be performed, None allows all layers in the timeline
  • new_layer_priority (int) – The priority/index of the layer container should be moved to. -1 means no move
  • mode (GES.EditMode) – The edit mode
  • edge (GES.Edge) – The edge of container where the edit should occur
  • position (int) – The edit position: a new location for the edge of container (in nanoseconds)
Returns:

True if the edit of container completed, False on failure.

Return type:

bool

Edits the container within its timeline.

Deprecated since version 1.18: use GES.TimelineElement.edit instead.

do_remove_child(element) virtual
Parameters:element (GES.TimelineElement) –
Return type:bool
do_ungroup(recursive) virtual
Parameters:recursive (bool) – Whether to recursively ungroup container
Returns:The list of new GES.Container-s created from the splitting of container.
Return type:[GES.Container]

Ungroups the container by splitting it into several containers containing various children of the original. The rules for how the container splits depends on the subclass. A GES.Group will simply split into its children. A GES.Clip will split into one GES.Clip per GES.TrackType it overlaps with (so an audio-video clip will split into an audio clip and a video clip), where each clip contains all the GES.TrackElement-s from the original clip with a matching GES.TrackElement :track-type.

If recursive is True, and the container contains other containers as children, then they will also be ungrouped, and so on.

Signal Details

GES.Container.signals.child_added(container, element)
Signal Name:

child-added

Flags:

RUN_FIRST

Parameters:

Will be emitted after a child is added to the container. Usually, you should connect with g_signal_connect_after() since the signal may be stopped internally.

GES.Container.signals.child_removed(container, element)
Signal Name:

child-removed

Flags:

RUN_LAST

Parameters:

Will be emitted after a child is removed from the container.

Property Details

GES.Container.props.height
Name:height
Type:int
Default Value:1
Flags:READABLE

The span of the container’s children’s GES.TimelineElement :priority values, which is the number of integers that lie between (inclusive) the minimum and maximum priorities found amongst the container’s children (maximum - minimum + 1).