pub trait TimelineElementExt:
    IsA<TimelineElement>
    + Sealed
    + 'static {
Show 54 methods // Provided methods fn add_child_property( &self, pspec: impl AsRef<ParamSpec>, child: &impl IsA<Object>, ) -> Result<(), BoolError> { ... } fn copy(&self, deep: bool) -> TimelineElement { ... } fn edit( &self, layers: &[Layer], new_layer_priority: i64, mode: EditMode, edge: Edge, position: u64, ) -> bool { ... } fn edit_full( &self, new_layer_priority: i64, mode: EditMode, edge: Edge, position: u64, ) -> Result<(), Error> { ... } fn child_property(&self, property_name: &str) -> Option<Value> { ... } fn child_property_by_pspec(&self, pspec: impl AsRef<ParamSpec>) -> Value { ... } fn duration(&self) -> ClockTime { ... } fn inpoint(&self) -> ClockTime { ... } fn layer_priority(&self) -> u32 { ... } fn max_duration(&self) -> Option<ClockTime> { ... } fn name(&self) -> Option<GString> { ... } fn natural_framerate(&self) -> Option<(i32, i32)> { ... } fn parent(&self) -> Option<TimelineElement> { ... } fn priority(&self) -> u32 { ... } fn start(&self) -> ClockTime { ... } fn timeline(&self) -> Option<Timeline> { ... } fn toplevel_parent(&self) -> TimelineElement { ... } fn track_types(&self) -> TrackType { ... } fn list_children_properties(&self) -> Vec<ParamSpec> { ... } fn lookup_child(&self, prop_name: &str) -> Option<(Object, ParamSpec)> { ... } fn paste( &self, paste_position: ClockTime, ) -> Result<TimelineElement, BoolError> { ... } fn remove_child_property( &self, pspec: impl AsRef<ParamSpec>, ) -> Result<(), BoolError> { ... } fn ripple(&self, start: ClockTime) -> Result<(), BoolError> { ... } fn ripple_end(&self, end: ClockTime) -> Result<(), BoolError> { ... } fn roll_end(&self, end: ClockTime) -> Result<(), BoolError> { ... } fn roll_start(&self, start: ClockTime) -> Result<(), BoolError> { ... } fn set_child_property( &self, property_name: &str, value: &Value, ) -> Result<(), BoolError> { ... } fn set_child_property_by_pspec( &self, pspec: impl AsRef<ParamSpec>, value: &Value, ) { ... } fn set_child_property_full( &self, property_name: &str, value: &Value, ) -> Result<(), Error> { ... } fn set_duration(&self, duration: impl Into<Option<ClockTime>>) -> bool { ... } fn set_inpoint(&self, inpoint: ClockTime) -> bool { ... } fn set_max_duration( &self, maxduration: impl Into<Option<ClockTime>>, ) -> bool { ... } fn set_name(&self, name: Option<&str>) -> Result<(), BoolError> { ... } fn set_parent( &self, parent: &impl IsA<TimelineElement>, ) -> Result<(), BoolError> { ... } fn set_priority(&self, priority: u32) -> bool { ... } fn set_start(&self, start: ClockTime) -> bool { ... } fn set_timeline( &self, timeline: &impl IsA<Timeline>, ) -> Result<(), BoolError> { ... } fn trim(&self, start: ClockTime) -> Result<(), BoolError> { ... } fn in_point(&self) -> u64 { ... } fn set_in_point(&self, in_point: u64) { ... } fn is_serialize(&self) -> bool { ... } fn set_serialize(&self, serialize: bool) { ... } fn connect_child_property_added<F: Fn(&Self, &Object, &ParamSpec) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_child_property_removed<F: Fn(&Self, &Object, &ParamSpec) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_deep_notify<F: Fn(&Self, &Object, &ParamSpec) + 'static>( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId { ... } fn connect_duration_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_in_point_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_max_duration_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_name_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_parent_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_priority_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_serialize_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_start_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... } fn connect_timeline_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all TimelineElement methods.

§Implementors

Container, TimelineElement, TrackElement

Provided Methods§

source

fn add_child_property( &self, pspec: impl AsRef<ParamSpec>, child: &impl IsA<Object>, ) -> Result<(), BoolError>

Register a property of a child of the element to allow it to be written with set_child_property() and read with child_property(). A change in the property will also appear in the deep-notify signal.

pspec should be unique from other children properties that have been registered on self.

§pspec

The specification for the property to add

§child

The gst::Object who the property belongs to

§Returns

true if the property was successfully registered.

source

fn copy(&self, deep: bool) -> TimelineElement

source

fn edit( &self, layers: &[Layer], new_layer_priority: i64, mode: EditMode, edge: Edge, position: u64, ) -> bool

See edit_full(), which also gives an error.

Note that the layers argument is currently ignored, so you should just pass None.

§layers

A whitelist of layers where the edit can be performed, None allows all layers in the timeline.

§new_layer_priority

The priority/index of the layer self should be moved to. -1 means no move

§mode

The edit mode

§edge

The edge of self where the edit should occur

§position

The edit position: a new location for the edge of self (in nanoseconds) in the timeline coordinates

§Returns

true if the edit of self completed, false on failure.

source

fn edit_full( &self, new_layer_priority: i64, mode: EditMode, edge: Edge, position: u64, ) -> Result<(), 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. See EditMode for details about each edit mode. An edit may fail if it would place one of these properties out of bounds, or if it would place the timeline in an unsupported configuration.

Note that if you act on a TrackElement, this will edit its parent Clip instead. Moreover, for any TimelineElement, if you select Edge::None for EditMode::Normal or EditMode::Ripple, this will edit the toplevel instead, but still in such a way as to make the start of self reach the edit position.

Note that if the element’s timeline has a snapping-distance set, then the edit position may be snapped to the edge of some element under the edited element.

new_layer_priority can be used to switch self, and other elements moved by the edit, to a new layer. New layers may be be created if the the corresponding layer priority/index does not yet exist for the timeline.

§new_layer_priority

The priority/index of the layer self should be moved to. -1 means no move

§mode

The edit mode

§edge

The edge of self where the edit should occur

§position

The edit position: a new location for the edge of self (in nanoseconds) in the timeline coordinates

§Returns

true if the edit of self completed, false on failure.

source

fn child_property(&self, property_name: &str) -> Option<Value>

Gets the property of a child of the element.

property_name can either be in the format “prop-name” or “TypeName::prop-name”, where “prop-name” is the name of the property to get (as used in [ObjectExt::get()][crate::glib::prelude::ObjectExt::get()]), and “TypeName” is the type name of the child (as returned by G_OBJECT_TYPE_NAME()). The latter format is useful when two children of different types share the same property name.

The first child found with the given “prop-name” property that was registered with add_child_property() (and of the type “TypeName”, if it was given) will have the corresponding property copied into value.

Note that ges_timeline_element_get_child_properties() may be more convenient for C programming.

§property_name

The name of the child property to get

§Returns

true if the property was found and copied to value.

§value

The return location for the value

source

fn child_property_by_pspec(&self, pspec: impl AsRef<ParamSpec>) -> Value

Gets the property of a child of the element. Specifically, the property corresponding to the pspec used in add_child_property() is copied into value.

§pspec

The specification of a registered child property to get

§Returns
§value

The return location for the value

source

fn duration(&self) -> ClockTime

Gets the duration for the element.

§Returns

The duration of self (in nanoseconds).

source

fn inpoint(&self) -> ClockTime

Gets the in-point for the element.

§Returns

The in-point of self (in nanoseconds).

source

fn layer_priority(&self) -> u32

Gets the priority of the layer the element is in. A Group may span several layers, so this would return the highest priority (numerically, the smallest) amongst them.

§Returns

The priority of the layer self is in, or GES_TIMELINE_ELEMENT_NO_LAYER_PRIORITY if self does not exist in a layer.

source

fn max_duration(&self) -> Option<ClockTime>

Gets the max-duration for the element.

§Returns

The max-duration of self (in nanoseconds).

source

fn name(&self) -> Option<GString>

Gets the name for the element.

§Returns

The name of self.

source

fn natural_framerate(&self) -> Option<(i32, i32)>

Get the “natural” framerate of self. This is to say, for example for a VideoUriSource the framerate of the source.

Note that a AudioSource may also have a natural framerate if it derives from the same SourceClip asset as a VideoSource, and its value will be that of the video source. For example, if the uri of a UriClip points to a file that contains both a video and audio stream, then the corresponding AudioUriSource will share the natural framerate of the corresponding VideoUriSource.

§Returns

Whether self has a natural framerate or not, framerate_n and framerate_d will be set to, respectively, 0 and -1 if it is not the case.

§framerate_n

The framerate numerator

§framerate_d

The framerate denominator

source

fn parent(&self) -> Option<TimelineElement>

Gets the parent for the element.

§Returns

The parent of self, or None if self has no parent.

source

fn priority(&self) -> u32

Gets the priority for the element.

§Returns

The priority of self.

source

fn start(&self) -> ClockTime

Gets the start for the element.

§Returns

The start of self (in nanoseconds).

source

fn timeline(&self) -> Option<Timeline>

Gets the timeline for the element.

§Returns

The timeline of self, or None if self has no timeline.

source

fn toplevel_parent(&self) -> TimelineElement

Gets the toplevel parent of the element.

§Returns

The toplevel parent of self.

source

fn track_types(&self) -> TrackType

Gets the track types that the element can interact with, i.e. the type of Track it can exist in, or will create TrackElement-s for.

§Returns

The track types that self supports.

source

fn list_children_properties(&self) -> Vec<ParamSpec>

Get a list of children properties of the element, which is a list of all the specifications passed to add_child_property().

§Returns

An array of glib::ParamSpec corresponding to the child properties of self, or None if something went wrong.

source

fn lookup_child(&self, prop_name: &str) -> Option<(Object, ParamSpec)>

Looks up a child property of the element.

prop_name can either be in the format “prop-name” or “TypeName::prop-name”, where “prop-name” is the name of the property to look up (as used in [ObjectExt::get()][crate::glib::prelude::ObjectExt::get()]), and “TypeName” is the type name of the child (as returned by G_OBJECT_TYPE_NAME()). The latter format is useful when two children of different types share the same property name.

The first child found with the given “prop-name” property that was registered with add_child_property() (and of the type “TypeName”, if it was given) will be passed to child, and the registered specification of this property will be passed to pspec.

§prop_name

The name of a child property

§Returns

true if a child corresponding to the property was found, in which case child and pspec are set.

§child

The return location for the found child

§pspec

The return location for the specification of the child property

source

fn paste(&self, paste_position: ClockTime) -> Result<TimelineElement, BoolError>

Paste an element inside the same timeline and layer as self. self must be the return of ges_timeline_element_copy() with deep=TRUE, and it should not be changed before pasting. self is not placed in the timeline, instead a new element is created, alike to the originally copied element. Note that the originally copied element must stay within the same timeline and layer, at both the point of copying and pasting.

Pasting may fail if it would place the timeline in an unsupported configuration.

After calling this function element should not be used. In particular, element can not be pasted again. Instead, you can copy the returned element and paste that copy (although, this is only possible if the paste was successful).

See also TimelineExt::paste_element().

§paste_position

The position in the timeline element should be pasted to, i.e. the start value for the pasted element.

§Returns

The newly created element, or None if pasting fails.

source

fn remove_child_property( &self, pspec: impl AsRef<ParamSpec>, ) -> Result<(), BoolError>

Remove a child property from the element. pspec should be a specification that was passed to add_child_property(). The corresponding property will no longer be registered as a child property for the element.

§pspec

The specification for the property to remove

§Returns

true if the property was successfully un-registered for self.

source

fn ripple(&self, start: ClockTime) -> Result<(), BoolError>

Edits the start time of an element within its timeline in ripple mode. See edit() with EditMode::Ripple and Edge::None.

§start

The new start time of self in ripple mode

§Returns

true if the ripple edit of self completed, false on failure.

source

fn ripple_end(&self, end: ClockTime) -> Result<(), BoolError>

Edits the end time of an element within its timeline in ripple mode. See edit() with EditMode::Ripple and Edge::End.

§end

The new end time of self in ripple mode

§Returns

true if the ripple edit of self completed, false on failure.

source

fn roll_end(&self, end: ClockTime) -> Result<(), BoolError>

Edits the end time of an element within its timeline in roll mode. See edit() with EditMode::Roll and Edge::End.

§end

The new end time of self in roll mode

§Returns

true if the roll edit of self completed, false on failure.

source

fn roll_start(&self, start: ClockTime) -> Result<(), BoolError>

Edits the start time of an element within its timeline in roll mode. See edit() with EditMode::Roll and Edge::Start.

§start

The new start time of self in roll mode

§Returns

true if the roll edit of self completed, false on failure.

source

fn set_child_property( &self, property_name: &str, value: &Value, ) -> Result<(), BoolError>

See set_child_property_full(), which also gives an error.

Note that ges_timeline_element_set_child_properties() may be more convenient for C programming.

§property_name

The name of the child property to set

§value

The value to set the property to

§Returns

true if the property was found and set.

source

fn set_child_property_by_pspec( &self, pspec: impl AsRef<ParamSpec>, value: &Value, )

Sets the property of a child of the element. Specifically, the property corresponding to the pspec used in add_child_property() is set to value.

§pspec

The specification of a registered child property to set

§value

The value to set the property to

source

fn set_child_property_full( &self, property_name: &str, value: &Value, ) -> Result<(), Error>

Sets the property of a child of the element.

property_name can either be in the format “prop-name” or “TypeName::prop-name”, where “prop-name” is the name of the property to set (as used in [ObjectExt::set()][crate::glib::prelude::ObjectExt::set()]), and “TypeName” is the type name of the child (as returned by G_OBJECT_TYPE_NAME()). The latter format is useful when two children of different types share the same property name.

The first child found with the given “prop-name” property that was registered with add_child_property() (and of the type “TypeName”, if it was given) will have the corresponding property set to value. Other children that may have also matched the property name (and type name) are left unchanged!

§property_name

The name of the child property to set

§value

The value to set the property to

§Returns

true if the property was found and set.

source

fn set_duration(&self, duration: impl Into<Option<ClockTime>>) -> bool

Sets duration for the element.

Whilst the element is part of a Timeline, this is the same as editing the element with edit() under EditMode::Trim with Edge::End. In particular, the duration of the element may be snapped to a different timeline time difference from the one given. In addition, setting may fail if it would place the timeline in an unsupported configuration, or the element does not have enough internal content to last the desired duration.

§duration

The desired duration in its timeline

§Returns

true if duration could be set for self.

source

fn set_inpoint(&self, inpoint: ClockTime) -> bool

Sets in-point for the element. If the new in-point is above the current max-duration of the element, this method will fail.

§inpoint

The in-point, in internal time coordinates

§Returns

true if inpoint could be set for self.

source

fn set_max_duration(&self, maxduration: impl Into<Option<ClockTime>>) -> bool

Sets max-duration for the element. If the new maximum duration is below the current in-point of the element, this method will fail.

§maxduration

The maximum duration, in internal time coordinates

§Returns

true if maxduration could be set for self.

source

fn set_name(&self, name: Option<&str>) -> Result<(), BoolError>

Sets the name for the element. If None is given for name, then the library will instead generate a new name based on the type name of the element, such as the name “uriclip3” for a UriClip, and will set that name instead.

If self already has a timeline, you should not call this function with name set to None.

You should ensure that, within each Timeline, every element has a unique name. If you call this function with name as None, then the library should ensure that the set generated name is unique from previously generated names. However, if you choose a name that interferes with the naming conventions of the library, the library will attempt to ensure that the generated names will not conflict with the chosen name, which may lead to a different name being set instead, but the uniqueness between generated and user-chosen names is not guaranteed.

§name

The name self should take

§Returns

true if name or a generated name for self could be set.

source

fn set_parent( &self, parent: &impl IsA<TimelineElement>, ) -> Result<(), BoolError>

Sets the parent for the element.

This is used internally and you should normally not call this. A Container will set the parent of its children in GESContainerExt::add() and GESContainerExt::remove().

Note, if parent is not None, self must not already have a parent set. Therefore, if you wish to switch parents, you will need to call this function twice: first to set the parent to None, and then to the new parent.

If parent is not None, you must ensure it already has a (non-floating) reference to self before calling this.

§Returns

true if parent could be set for self.

source

fn set_priority(&self, priority: u32) -> bool

👎Deprecated: Since 1.10

Sets the priority of the element within the containing layer.

§Deprecated since 1.10

All priority management is done by GES itself now. To set Effect priorities ges_clip_set_top_effect_index should be used.

§priority

The priority

§Returns

true if priority could be set for self.

source

fn set_start(&self, start: ClockTime) -> bool

Sets start for the element. If the element has a parent, this will also move its siblings with the same shift.

Whilst the element is part of a Timeline, this is the same as editing the element with edit() under EditMode::Normal with Edge::None. In particular, the start of the element may be snapped to a different timeline time from the one given. In addition, setting may fail if it would place the timeline in an unsupported configuration.

§start

The desired start position of the element in its timeline

§Returns

true if start could be set for self.

source

fn set_timeline(&self, timeline: &impl IsA<Timeline>) -> Result<(), BoolError>

Sets the timeline of the element.

This is used internally and you should normally not call this. A Clip will have its timeline set through its Layer. A Track will similarly take care of setting the timeline of its TrackElement-s. A Group will adopt the same timeline as its children.

If timeline is None, this will stop its current timeline from tracking it, otherwise timeline will start tracking self. Note, in the latter case, self must not already have a timeline set. Therefore, if you wish to switch timelines, you will need to call this function twice: first to set the timeline to None, and then to the new timeline.

§Returns

true if timeline could be set for self.

source

fn trim(&self, start: ClockTime) -> Result<(), BoolError>

Edits the start time of an element within its timeline in trim mode. See edit() with EditMode::Trim and Edge::Start.

§start

The new start time of self in trim mode

§Returns

true if the trim edit of self completed, false on failure.

source

fn in_point(&self) -> u64

The initial offset to use internally when outputting content (in nanoseconds, but in the time coordinates of the internal content).

For example, for a VideoUriSource that references some media file, the “internal content” is the media file data, and the in-point would correspond to some timestamp in the media file. When playing the timeline, and when the element is first reached at timeline-time start, it will begin outputting the data from the timestamp in-point onwards, until it reaches the end of its duration in the timeline.

For elements that have no internal content, this should be kept as 0.

source

fn set_in_point(&self, in_point: u64)

The initial offset to use internally when outputting content (in nanoseconds, but in the time coordinates of the internal content).

For example, for a VideoUriSource that references some media file, the “internal content” is the media file data, and the in-point would correspond to some timestamp in the media file. When playing the timeline, and when the element is first reached at timeline-time start, it will begin outputting the data from the timestamp in-point onwards, until it reaches the end of its duration in the timeline.

For elements that have no internal content, this should be kept as 0.

source

fn is_serialize(&self) -> bool

Whether the element should be serialized.

source

fn set_serialize(&self, serialize: bool)

Whether the element should be serialized.

source

fn connect_child_property_added<F: Fn(&Self, &Object, &ParamSpec) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when the element has a new child property registered. See add_child_property().

Note that some GES elements will be automatically created with pre-registered children properties. You can use list_children_properties() to list these.

§prop_object

The child whose property has been registered

§prop

The specification for the property that has been registered

source

fn connect_child_property_removed<F: Fn(&Self, &Object, &ParamSpec) + 'static>( &self, f: F, ) -> SignalHandlerId

Emitted when the element has a child property unregistered. See remove_child_property().

§prop_object

The child whose property has been unregistered

§prop

The specification for the property that has been unregistered

source

fn connect_deep_notify<F: Fn(&Self, &Object, &ParamSpec) + 'static>( &self, detail: Option<&str>, f: F, ) -> SignalHandlerId

Emitted when a child of the element has one of its registered properties set. See add_child_property(). Note that unlike notify, a child property name can not be used as a signal detail.

§prop_object

The child whose property has been set

§prop

The specification for the property that been set

source

fn connect_duration_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_in_point_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_max_duration_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_parent_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_priority_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

👎Deprecated: Since 1.10
source

fn connect_serialize_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_start_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

source

fn connect_timeline_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Object Safety§

This trait is not object safe.

Implementors§