A TimelineElement will have some temporal extent in its corresponding
timeline, controlled by its
start and
duration.
This determines when its content will be displayed, or its effect applied, in the timeline. Several objects may overlap within a given
Timeline, in which case their
priority is used to determine their ordering in the timeline. Priority is mostly handled internally by
Layer-s and Clip-s.
A timeline element can have a parent, such as a
Clip, which is responsible for controlling its timing.
Editing
Elements can be moved around in their timeline by setting their
start and
duration using set_start and
set_duration. Additionally, which parts of the underlying
content are played in the timeline can be adjusted by setting the in_point
using set_inpoint. The library also provides
edit, with various EditMode-s,
which can adjust these properties in a convenient way, as well as introduce similar changes in neighbouring or later elements in the
timeline.
However, a timeline may refuse a change in these properties if they would place the timeline in an unsupported configuration. See
Timeline for its overlap rules.
Additionally, an edit may be refused if it would place one of the timing properties out of bounds (such as a negative time value for
start, or having insufficient internal content to last for the desired
duration).
Time Coordinates
There are three main sets of time coordinates to consider when using timeline elements:
+ Timeline coordinates: these are the time coordinates used in the output of the timeline in its
Track-s. Each track share the same coordinates, so there is only one set of coordinates for the timeline. These extend
indefinitely from 0. The times used for editing (including setting start
and duration) use these coordinates, since these define when an element
is present and for how long the element lasts for in the timeline. + Internal source coordinates: these are the time coordinates used
internally at the element's output. This is only really defined for TrackElement
-s, where it refers to time coordinates used at the final source pad of the wrapped Element-s.
However, these coordinates may also be used in a Clip in reference to its children.
In particular, these are the coordinates used for in_point and
max_duration. + Internal sink coordinates: these are the time
coordinates used internally at the element's input. A Source has no input, so these would be
undefined. Otherwise, for most TrackElement-s these will be the same set of
coordinates as the internal source coordinates because the element does not change the timing internally. Only
BaseEffect can support elements where these are different. See
BaseEffect for more information.
You can determine the timeline time for a given internal source time in a Track in a
Clip using
get_timeline_time_from_internal_time, and vice versa using
get_internal_time_from_timeline_time, for the purposes of
editing and setting timings properties.
Children Properties
If a timeline element owns another Object and wishes to expose some of its properties, it can do so
by registering the property as one of the timeline element's children properties using
add_child_property. The registered property of the child can then
be read and set using the get_child_property and
set_child_property methods, respectively. Some
sub-classed objects will be created with pre-registered children properties; for example, to expose part of an underlying
Element that is used internally. The registered properties can be listed with
list_children_properties.
- public bool add_child_property (ParamSpec pspec, Object child)
- public unowned TimelineElement copy (bool deep)
Create a copy of this.
- public virtual void deep_copy (TimelineElement copy)
- public bool edit (List<Layer>? layers, int64 new_layer_priority, EditMode mode, Edge edge, uint64 position)
- public bool edit_full (int64 new_layer_priority, EditMode mode, Edge edge, uint64 position) throws Error
Edits the element within its timeline by adjusting its
start,
duration or in_point, and potentially doing the same for other
elements in the timeline.
- public bool get_child_property (string property_name, out Value value)
Gets the property of a child of the element.
- public Value get_child_property_by_pspec (ParamSpec pspec)
Gets the property of a child of the element.
- public ClockTime get_duration ()
- public ClockTime get_inpoint ()
- public virtual uint32 get_layer_priority ()
Gets the priority of the layer the element is in.
- public ClockTime get_max_duration ()
- public string get_name ()
Gets the name
for the element.
- public virtual bool get_natural_framerate (out int framerate_n, out int framerate_d)
Get the "natural" framerate of this.
- public TimelineElement? get_parent ()
Gets the
parent for the element.
- public uint32 get_priority ()
- public ClockTime get_start ()
Gets the
start for the element.
- public Timeline? get_timeline ()
- public TimelineElement get_toplevel_parent ()
Gets the toplevel
parent of the element.
- public virtual TrackType get_track_types ()
Gets the track types that the element can interact with, i.
- public ParamSpec[] list_children_properties ()
Get a list of children properties of the element, which is a list of
all the specifications passed to add_child_property.
- public virtual bool lookup_child (string prop_name, out Object child, out ParamSpec pspec)
Looks up a child property of the element.
- public TimelineElement? paste (ClockTime paste_position)
Paste an element inside the same timeline and layer as
this.
- public bool remove_child_property (ParamSpec pspec)
Remove a child property from the element.
- public virtual bool ripple (uint64 start)
Edits the start time of an element within its timeline in ripple mode.
- public virtual bool ripple_end (uint64 end)
Edits the end time of an element within its timeline in ripple mode.
- public virtual bool roll_end (uint64 end)
Edits the end time of an element within its timeline in roll mode.
- public virtual bool roll_start (uint64 start)
Edits the start time of an element within its timeline in roll mode.
- public virtual void set_child_property (Object child, ParamSpec pspec, Value value)
- public void set_child_property_by_pspec (ParamSpec pspec, Value value)
Sets the property of a child of the element.
- public virtual bool set_child_property_full (Object child, ParamSpec pspec, Value value) throws Error
Sets the property of a child of the element.
- public virtual bool set_duration (ClockTime duration)
- public virtual bool set_inpoint (ClockTime inpoint)
- public virtual bool set_max_duration (ClockTime maxduration)
- public bool set_name (string? name)
Sets the name
for the element.
- public virtual bool set_parent (TimelineElement parent)
Sets the
parent for the element.
- public virtual bool set_priority (uint32 priority)
Sets the priority of the element within the containing layer.
- public virtual bool set_start (ClockTime start)
Sets start
for the element.
- public bool set_timeline (Timeline timeline)
- public virtual bool trim (uint64 start)
Edits the start time of an element within its timeline in trim mode.