[][src]Trait gstreamer_editing_services::TimelineExt

pub trait TimelineExt: 'static {
    fn add_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), BoolError>;
fn add_track<P: IsA<Track>>(&self, track: &P) -> Result<(), BoolError>;
fn append_layer(&self) -> Layer;
fn commit(&self) -> bool;
fn commit_sync(&self) -> bool;
fn get_auto_transition(&self) -> bool;
fn get_duration(&self) -> ClockTime;
fn get_element(&self, name: &str) -> Option<TimelineElement>;
fn get_groups(&self) -> Vec<Group>;
fn get_layer(&self, priority: u32) -> Option<Layer>;
fn get_layers(&self) -> Vec<Layer>;
fn get_pad_for_track<P: IsA<Track>>(&self, track: &P) -> Option<Pad>;
fn get_snapping_distance(&self) -> ClockTime;
fn get_track_for_pad<P: IsA<Pad>>(&self, pad: &P) -> Option<Track>;
fn get_tracks(&self) -> Vec<Track>;
fn is_empty(&self) -> bool;
fn load_from_uri(&self, uri: &str) -> Result<(), Error>;
fn move_layer<P: IsA<Layer>>(
        &self,
        layer: &P,
        new_layer_priority: u32
    ) -> Result<(), BoolError>;
fn paste_element<P: IsA<TimelineElement>>(
        &self,
        element: &P,
        position: ClockTime,
        layer_priority: i32
    ) -> Option<TimelineElement>;
fn remove_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), BoolError>;
fn remove_track<P: IsA<Track>>(&self, track: &P) -> Result<(), BoolError>;
fn save_to_uri<P: IsA<Asset>>(
        &self,
        uri: &str,
        formatter_asset: Option<&P>,
        overwrite: bool
    ) -> Result<(), Error>;
fn set_auto_transition(&self, auto_transition: bool);
fn set_snapping_distance(&self, snapping_distance: ClockTime);
fn connect_commited<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_group_added<F: Fn(&Self, &Group) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_layer_added<F: Fn(&Self, &Layer) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_layer_removed<F: Fn(&Self, &Layer) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_snapping_ended<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_snapping_started<F: Fn(&Self, &TrackElement, &TrackElement, u64) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_track_added<F: Fn(&Self, &Track) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_track_removed<F: Fn(&Self, &Track) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_auto_transition_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_duration_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_property_snapping_distance_notify<F: Fn(&Self) + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all Timeline methods.

Implementors

Timeline

Required methods

fn add_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), BoolError>

Add the layer to the timeline. The reference to the layer will be stolen by the self.

layer

the Layer to add

Returns

true if the layer was properly added, else false.

fn add_track<P: IsA<Track>>(&self, track: &P) -> Result<(), BoolError>

Add a track to the timeline. The reference to the track will be stolen by the pipeline.

track

the Track to add

Returns

true if the track was properly added, else false.

fn append_layer(&self) -> Layer

Append a newly created Layer to self Note that you do not own any reference to the returned layer.

Returns

The newly created Layer, or the last (empty) Layer of self.

fn commit(&self) -> bool

Commit all the pending changes of the clips contained in the self.

When changes happen in a timeline, they are not directly executed in the non-linear engine. Call this method once you are done with a set of changes and want it to be executed.

The Timeline::commited signal will be emitted when the (possibly updated) gst::Pipeline is ready to output data again, except if the state of the timeline was gst::State::Ready or gst::State::Null.

Note that all the pending changes will automatically be executed when the timeline goes from gst::State::Ready to gst::State::Paused, which usually is triggered by corresponding state changes in a containing Pipeline.

You should not try to change the state of the timeline, seek it or add tracks to it during a commit operation, that is between a call to this function and after receiving the Timeline::commited signal.

See TimelineExt::commit_sync if you don't want to bother with waiting for the signal.

Returns

true if pending changes were commited or false if nothing needed to be commited

fn commit_sync(&self) -> bool

Commit all the pending changes of the GESClips contained in the self.

Will return once the update is complete, that is when the (possibly updated) gst::Pipeline is ready to output data again, or if the state of the timeline was gst::State::Ready or gst::State::Null.

This function will wait for any pending state change of the timeline by calling gst::ElementExt::get_state with a GST_CLOCK_TIME_NONE timeout, you should not try to change the state from another thread before this function has returned.

See TimelineExt::commit for more information.

Returns

true if pending changes were commited or false if nothing needed to be commited

fn get_auto_transition(&self) -> bool

Gets whether transitions are automatically added when objects overlap or not.

Returns

true if transitions are automatically added, else false.

fn get_duration(&self) -> ClockTime

Get the current duration of self

Returns

The current duration of self

fn get_element(&self, name: &str) -> Option<TimelineElement>

Gets a TimelineElement contained in the timeline

Returns

The TimelineElement or None if not found.

fn get_groups(&self) -> Vec<Group>

Get the list of Group present in the Timeline.

Returns

the list of Group that contain clips present in the timeline's layers. Must not be changed.

fn get_layer(&self, priority: u32) -> Option<Layer>

Retrieve the layer with priority as a priority

priority

The priority of the layer to find

Returns

A Layer or None if no layer with priority was found

Since 1.6

fn get_layers(&self) -> Vec<Layer>

Get the list of Layer present in the Timeline.

Returns

the list of Layer present in the Timeline sorted by priority. The caller should unref each Layer once he is done with them.

fn get_pad_for_track<P: IsA<Track>>(&self, track: &P) -> Option<Pad>

Search the gst::Pad corresponding to the given self's track.

track

The Track

Returns

The corresponding gst::Pad if it is found, or None if there is an error.

fn get_snapping_distance(&self) -> ClockTime

Gets the configured snapping distance of the timeline. See the documentation of the property snapping_distance for more information.

Returns

The snapping_distance property of the timeline

fn get_track_for_pad<P: IsA<Pad>>(&self, pad: &P) -> Option<Track>

Search the Track corresponding to the given self's pad.

pad

The gst::Pad

Returns

The corresponding Track if it is found, or None if there is an error.

fn get_tracks(&self) -> Vec<Track>

Returns the list of Track used by the Timeline.

Returns

A list of Track. The caller should unref each track once he is done with them.

fn is_empty(&self) -> bool

Check whether a Timeline is empty or not

Returns

true if the timeline is empty false otherwize

fn load_from_uri(&self, uri: &str) -> Result<(), Error>

Loads the contents of URI into the given timeline.

uri

The URI to load from

Returns

true if the timeline was loaded successfully, or false if the uri could not be loaded.

fn move_layer<P: IsA<Layer>>(
    &self,
    layer: &P,
    new_layer_priority: u32
) -> Result<(), BoolError>

Moves layer at new_layer_priority meaning that layer we land at that position in the stack of layers inside the timeline. If new_layer_priority is superior than the number of layers present in the time, it will move to the end of the stack of layers.

Feature: v1_16

layer

The layer to move at new_layer_priority

new_layer_priority

The index at which layer should land

fn paste_element<P: IsA<TimelineElement>>(
    &self,
    element: &P,
    position: ClockTime,
    layer_priority: i32
) -> Option<TimelineElement>

Paste element inside the timeline. element must have been created using ges_timeline_element_copy with deep=TRUE set, i.e. it must be a deep copy, otherwise it will fail.

element

The TimelineElement to paste

position

The position in the timeline the element should be pasted to, meaning it will become the start of element

layer_priority

The Layer to which the element should be pasted to. -1 means paste to the same layer from which the element has been copied from.

Returns

Shallow copy of the element pasted

fn remove_layer<P: IsA<Layer>>(&self, layer: &P) -> Result<(), BoolError>

Removes the layer from the timeline. The reference that the self holds on the layer will be dropped. If you wish to use the layer after calling this method, you need to take a reference before calling.

layer

the Layer to remove

Returns

true if the layer was properly removed, else false.

fn remove_track<P: IsA<Track>>(&self, track: &P) -> Result<(), BoolError>

Remove the track from the self. The reference stolen when adding the track will be removed. If you wish to use the track after calling this function you must ensure that you have a reference to it.

track

the Track to remove

Returns

true if the track was properly removed, else false.

fn save_to_uri<P: IsA<Asset>>(
    &self,
    uri: &str,
    formatter_asset: Option<&P>,
    overwrite: bool
) -> Result<(), Error>

Saves the timeline to the given location

uri

The location to save to

formatter_asset

The formatter asset to use or None. If None, will try to save in the same format as the one from which the timeline as been loaded or default to the formatter with highest rank

overwrite

true to overwrite file if it exists

Returns

true if the timeline was successfully saved to the given location, else false.

fn set_auto_transition(&self, auto_transition: bool)

Sets the layer to the given auto_transition. See the documentation of the property auto_transition for more information.

auto_transition

whether the auto_transition is active

fn set_snapping_distance(&self, snapping_distance: ClockTime)

Sets the snapping_distance of the timeline. See the documentation of the property snapping_distance for more information.

snapping_distance

whether the snapping_distance is active

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

This signal will be emitted once the changes initiated by TimelineExt::commit have been executed in the backend. Use TimelineExt::commit_sync if you don't need to do anything in the meantime.

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

Will be emitted after a new group is added to to the timeline.

group

the Group

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

Will be emitted after a new layer is added to the timeline.

layer

the Layer that was added to the timeline

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

Will be emitted after the layer was removed from the timeline.

layer

the Layer that was removed from the timeline

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

Will be emitted when the 2 TrackElement ended to snap

obj1

the first TrackElement that was snapping.

obj2

the second TrackElement that was snapping.

position

the position where the two objects finally snapping.

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

Will be emitted when the 2 TrackElement first snapped

obj1

the first TrackElement that was snapping.

obj2

the second TrackElement that was snapping.

position

the position where the two objects finally snapping.

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

Will be emitted after the track was added to the timeline.

track

the Track that was added to the timeline

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

Will be emitted after the track was removed from the timeline.

track

the Track that was removed from the timeline

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

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

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

Loading content...

Implementors

impl<O: IsA<Timeline>> TimelineExt for O[src]

Loading content...