[][src]Trait gstreamer_editing_services::prelude::TimelineElementExt

pub trait TimelineElementExt: 'static {
    fn copy(&self, deep: bool) -> Result<TimelineElement, BoolError>;
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 get_duration(&self) -> ClockTime;
fn get_inpoint(&self) -> ClockTime;
fn get_layer_priority(&self) -> u32;
fn get_max_duration(&self) -> ClockTime;
fn get_name(&self) -> Option<GString>;
fn get_natural_framerate(&self) -> Option<(i32, i32)>;
fn get_parent(&self) -> Option<TimelineElement>;
fn get_priority(&self) -> u32;
fn get_start(&self) -> ClockTime;
fn get_timeline(&self) -> Option<Timeline>;
fn get_toplevel_parent(&self) -> Option<TimelineElement>;
fn get_track_types(&self) -> TrackType;
fn paste(
        &self,
        paste_position: ClockTime
    ) -> Result<TimelineElement, 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_duration(&self, duration: ClockTime) -> bool;
fn set_inpoint(&self, inpoint: ClockTime) -> bool;
fn set_max_duration(&self, maxduration: ClockTime) -> bool;
fn set_name(&self, name: Option<&str>) -> Result<(), BoolError>;
fn set_parent<P: IsA<TimelineElement>>(
        &self,
        parent: &P
    ) -> Result<(), BoolError>;
fn set_priority(&self, priority: u32) -> bool;
fn set_start(&self, start: ClockTime) -> bool;
fn set_timeline<P: IsA<Timeline>>(
        &self,
        timeline: &P
    ) -> Result<(), BoolError>;
fn trim(&self, start: ClockTime) -> Result<(), BoolError>;
fn get_property_in_point(&self) -> u64;
fn set_property_in_point(&self, in_point: u64);
fn get_property_serialize(&self) -> bool;
fn set_property_serialize(&self, serialize: bool);
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_in_point_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_max_duration_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_name_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_parent_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_priority_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_serialize_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_start_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_timeline_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all TimelineElement methods.

Implementors

Container, TimelineElement, TrackElement

Required methods

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

Create a copy of self. All the properties of self are copied into a new element, with the exception of TimelineElement:parent, TimelineElement:timeline and TimelineElement:name. Other data, such the list of a Container's children, is not copied.

If deep is true, then the new element is prepared so that it can be used in TimelineElementExt::paste or TimelineExt::paste_element. In the case of copying a Container, this ensures that the children of self will also be pasted. The new element should not be used for anything else and can only be used once in a pasting operation. In particular, the new element itself is not an actual 'deep' copy of self, but should be thought of as an intermediate object used for a single paste operation.

deep

Whether the copy is needed for pasting

Returns

The newly create element, copied from self.

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

See TimelineElementExt::edit_full, which also gives an error.

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

Feature: v1_18

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.

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 TimelineElement:start, TimelineElement:duration or TimelineElement: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 TimelineElement:start of self reach the edit position.

Note that if the element's timeline has a Timeline: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.

Feature: v1_18

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.

fn get_duration(&self) -> ClockTime

Gets the TimelineElement:duration for the element.

Returns

The duration of self (in nanoseconds).

fn get_inpoint(&self) -> ClockTime

Gets the TimelineElement:in-point for the element.

Returns

The in-point of self (in nanoseconds).

fn get_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.

Feature: v1_16

Returns

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

fn get_max_duration(&self) -> ClockTime

Gets the TimelineElement:max-duration for the element.

Returns

The max-duration of self (in nanoseconds).

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

Gets the TimelineElement:name for the element.

Returns

The name of self.

fn get_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.

Feature: v1_18

framerate_n

The framerate numerator

framerate_d

The framerate denominator

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.

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

Gets the TimelineElement:parent for the element.

Returns

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

fn get_priority(&self) -> u32

Gets the TimelineElement:priority for the element.

Returns

The priority of self.

fn get_start(&self) -> ClockTime

Gets the TimelineElement:start for the element.

Returns

The start of self (in nanoseconds).

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

Gets the TimelineElement:timeline for the element.

Returns

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

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

Gets the toplevel TimelineElement:parent of the element.

Returns

The toplevel parent of self.

fn get_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.

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 TimelineElementExt::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 TimelineElement:start value for the pasted element.

Returns

The newly created element, or None if pasting fails.

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

Edits the start time of an element within its timeline in ripple mode. See TimelineElementExt::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.

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

Edits the end time of an element within its timeline in ripple mode. See TimelineElementExt::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.

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

Edits the end time of an element within its timeline in roll mode. See TimelineElementExt::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.

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

Edits the start time of an element within its timeline in roll mode. See TimelineElementExt::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.

fn set_duration(&self, duration: ClockTime) -> bool

Sets TimelineElement:duration for the element.

Whilst the element is part of a Timeline, this is the same as editing the element with TimelineElementExt::edit under EditMode::Trim with Edge::End. In particular, the TimelineElement: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.

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

Sets TimelineElement:in-point for the element. If the new in-point is above the current TimelineElement: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.

fn set_max_duration(&self, maxduration: ClockTime) -> bool

Sets TimelineElement:max-duration for the element. If the new maximum duration is below the current TimelineElement: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.

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

Sets the TimelineElement: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 TimelineElement: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.

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

Sets the TimelineElement:parent for the element.

This is used internally and you should normally not call this. A Container will set the TimelineElement: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.

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

👎 Deprecated

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 ClipExt::set_top_effect_index should be used.

priority

The priority

Returns

true if priority could be set for self.

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

Sets TimelineElement: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 TimelineElementExt::edit under EditMode::Normal with Edge::None. In particular, the TimelineElement: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.

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

Sets the TimelineElement:timeline of the element.

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

If timeline is None, this will stop its current TimelineElement: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.

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

Edits the start time of an element within its timeline in trim mode. See TimelineElementExt::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.

fn get_property_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 TimelineElement:start, it will begin outputting the data from the timestamp in-point onwards, until it reaches the end of its TimelineElement:duration in the timeline.

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

fn set_property_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 TimelineElement:start, it will begin outputting the data from the timestamp in-point onwards, until it reaches the end of its TimelineElement:duration in the timeline.

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

fn get_property_serialize(&self) -> bool

Whether the element should be serialized.

fn set_property_serialize(&self, serialize: bool)

Whether the element should be serialized.

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

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

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

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

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

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

👎 Deprecated

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

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

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

Loading content...

Implementors

impl<O: IsA<TimelineElement>> TimelineElementExt for O[src]

Loading content...