GES.Clip

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

Subclasses:GES.OperationClip, GES.SourceClip

Methods

Inherited:GES.Container (6), GES.TimelineElement (33), GObject.Object (40), GES.Extractable (3), GES.MetaContainer (37)
Structs:GObject.ObjectClass (5)
  add_asset (asset)
  find_track_element (track, type)
  find_track_elements (track, track_type, type)
  get_layer ()
  get_supported_formats ()
  get_top_effect_index (effect)
  get_top_effect_position (effect)
  get_top_effects ()
  move_to_layer (layer)
  set_supported_formats (supportedformats)
  set_top_effect_index (effect, newindex)
  set_top_effect_priority (effect, newpriority)
  split (position)

Properties

Inherited:GES.Container (1), GES.TimelineElement (9)
Name Type Flags Short Description
layer GES.Layer r The GES.Layer where this clip is being used.
supported-formats GES.TrackType r/w/c Formats supported by the file

Fields

Inherited:GES.Container (2), GES.TimelineElement (1), GObject.Object (1), GES.MetaContainer (1)
Name Type Access Description
parent GES.Container r  

Class Details

class GES.Clip(**kwargs)
Bases:GES.Container
Abstract:Yes
Structure:GES.ClipClass

A GES.Clip is a ‘natural’ object which controls one or more GES.TrackElement(s) in one or more GES.Track(s).

Keeps a reference to the GES.TrackElement(s) it created and sets/updates their properties.

add_asset(asset)[source]
Parameters:asset (GES.Asset) – a GES.Asset with #GES_TYPE_TRACK_ELEMENT as extractable_type
Returns:Created GES.TrackElement or None if an error happened
Return type:GES.TrackElement or None

Extracts a GES.TrackElement from asset and adds it to the self. Should only be called in order to add operations to a GES.Clip, ni other cases TrackElement are added automatically when adding the GES.Clip/GES.Asset to a layer.

Takes a reference on track_element.

find_track_element(track, type)[source]
Parameters:
Returns:

The GES.TrackElement used by track, else None. Unref after usage

Return type:

GES.TrackElement or None

Finds the GES.TrackElement controlled by self that is used in track. You may optionally specify a GObject.GType to further narrow search criteria.

Note: If many objects match, then the one with the highest priority will be returned.

find_track_elements(track, track_type, type)[source]
Parameters:
Returns:

a GLib.List of the GES.TrackElement contained in self. The refcount of the objects will be increased. The user will have to unref each GES.TrackElement and free the GLib.List.

Return type:

[GES.TrackElement]

Finds all the GES.TrackElement controlled by self that is used in track. You may optionally specify a GObject.GType to further narrow search criteria.

get_layer()[source]
Returns:The GES.Layer where this self is being used, or None if it is not used on any layer. The caller should unref it usage.
Return type:GES.Layer or None

Get the GES.Layer to which this clip belongs.

get_supported_formats()[source]
Returns:The formats supported by self.
Return type:GES.TrackType

Get the formats supported by self.

get_top_effect_index(effect)[source]
Parameters:effect (GES.BaseEffect) – The GES.BaseEffect we want to get the top index from
Returns:The top index of the effect, -1 if something went wrong.
Return type:int

Gets the index position of an effect.

get_top_effect_position(effect)[source]
Parameters:effect (GES.BaseEffect) –
Return type:int
get_top_effects()[source]
Returns:a GLib.List of the GES.BaseEffect that are applied on self order by ascendant priorities. The refcount of the objects will be increased. The user will have to unref each GES.BaseEffect and free the GLib.List.
Return type:[GES.TrackElement]

Get effects applied on self

move_to_layer(layer)[source]
Parameters:layer (GES.Layer) – the new GES.Layer
Returns:True if self could be moved False otherwize
Return type:bool

Moves self to layer. If self is not in any layer, it adds it to layer, else, it removes it from its current layer, and adds it to layer.

set_supported_formats(supportedformats)[source]
Parameters:supportedformats (GES.TrackType) – the GES.TrackType defining formats supported by self

Sets the formats supported by the file.

set_top_effect_index(effect, newindex)[source]
Parameters:
Returns:

True if effect was successfuly moved, False otherwise.

Return type:

bool

This is a convenience method that lets you set the index of a top effect.

set_top_effect_priority(effect, newpriority)[source]
Parameters:
Return type:

bool

split(position)[source]
Parameters:position (int) – a #GstClockTime representing the timeline position at which to split
Returns:The newly created GES.Clip resulting from the splitting or None if the clip can’t be split.
Return type:GES.Clip or None

The function modifies self, and creates another GES.Clip so we have two clips at the end, splitted at the time specified by position, as a position in the timeline (not in the clip to be split). For example, if GES.Clip.split is called on a 4-second clip playing from 0:01.00 until 0:05.00, with a split position of 0:02.00, this will result in one clip of 1 second and one clip of 3 seconds, not in two clips of 2 seconds.

The newly created clip will be added to the same layer as self is in. This implies that self must be in a GES.Layer for the operation to be possible.

This method supports clips playing at a different tempo than one second per second. For example, splitting a clip with a GES.Effect ‘pitch tempo=1.5’ four seconds after it starts, will set the inpoint of the new clip to six seconds after that of the clip to split. For this, the rate-changing property must be registered using ges_effect_class_register_rate_property; for the ‘pitch’ plugin, this is already done.

Property Details

GES.Clip.props.layer
Name:layer
Type:GES.Layer
Default Value:None
Flags:READABLE

The GES.Layer where this clip is being used. If you want to connect to its notify signal you should connect to it with g_signal_connect_after as the signal emission can be stop in the first fase.

GES.Clip.props.supported_formats
Name:supported-formats
Type:GES.TrackType
Default Value:GES.TrackType.VIDEO | GES.TrackType.AUDIO
Flags:READABLE, WRITABLE, CONSTRUCT

The formats supported by the clip.