pub trait LayerExt: IsA<Layer> + Sealed + 'static {
Show 21 methods // Provided methods fn add_asset( &self, asset: &impl IsA<Asset>, start: impl Into<Option<ClockTime>>, inpoint: impl Into<Option<ClockTime>>, duration: impl Into<Option<ClockTime>>, track_types: TrackType ) -> Result<Clip, BoolError> { ... } fn add_asset_full( &self, asset: &impl IsA<Asset>, start: impl Into<Option<ClockTime>>, inpoint: impl Into<Option<ClockTime>>, duration: impl Into<Option<ClockTime>>, track_types: TrackType ) -> Result<Clip, Error> { ... } fn add_clip(&self, clip: &impl IsA<Clip>) -> Result<(), BoolError> { ... } fn add_clip_full(&self, clip: &impl IsA<Clip>) -> Result<(), Error> { ... } fn is_active_for_track(&self, track: &impl IsA<Track>) -> bool { ... } fn is_auto_transition(&self) -> bool { ... } fn clips(&self) -> Vec<Clip> { ... } fn clips_in_interval( &self, start: impl Into<Option<ClockTime>>, end: impl Into<Option<ClockTime>> ) -> Vec<Clip> { ... } fn duration(&self) -> ClockTime { ... } fn priority(&self) -> u32 { ... } fn timeline(&self) -> Option<Timeline> { ... } fn is_empty(&self) -> bool { ... } fn remove_clip(&self, clip: &impl IsA<Clip>) -> Result<(), BoolError> { ... } fn set_active_for_tracks(&self, active: bool, tracks: &[Track]) -> bool { ... } fn set_auto_transition(&self, auto_transition: bool) { ... } fn set_priority(&self, priority: u32) { ... } fn set_timeline(&self, timeline: &impl IsA<Timeline>) { ... } fn connect_clip_added<F: Fn(&Self, &Clip) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_clip_removed<F: Fn(&Self, &Clip) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_auto_transition_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... } fn connect_priority_notify<F: Fn(&Self) + 'static>( &self, f: F ) -> SignalHandlerId { ... }
}
Expand description

Trait containing all Layer methods.

§Implementors

Layer

Provided Methods§

source

fn add_asset( &self, asset: &impl IsA<Asset>, start: impl Into<Option<ClockTime>>, inpoint: impl Into<Option<ClockTime>>, duration: impl Into<Option<ClockTime>>, track_types: TrackType ) -> Result<Clip, BoolError>

See add_asset_full(), which also gives an error.

§asset

The asset to extract the new clip from

§start

The start value to set on the new clip If start == GST_CLOCK_TIME_NONE``, it will be added to the end of self, i.e. it will be set to self’s duration

§inpoint

The in-point value to set on the new clip

§duration

The duration value to set on the new clip

§track_types

The supported-formats to set on the the new clip, or TrackType::UNKNOWN to use the default

§Returns

The newly created clip.

source

fn add_asset_full( &self, asset: &impl IsA<Asset>, start: impl Into<Option<ClockTime>>, inpoint: impl Into<Option<ClockTime>>, duration: impl Into<Option<ClockTime>>, track_types: TrackType ) -> Result<Clip, Error>

Extracts a new clip from an asset and adds it to the layer with the given properties.

§asset

The asset to extract the new clip from

§start

The start value to set on the new clip If start == GST_CLOCK_TIME_NONE``, it will be added to the end of self, i.e. it will be set to self’s duration

§inpoint

The in-point value to set on the new clip

§duration

The duration value to set on the new clip

§track_types

The supported-formats to set on the the new clip, or TrackType::UNKNOWN to use the default

§Returns

The newly created clip.

source

fn add_clip(&self, clip: &impl IsA<Clip>) -> Result<(), BoolError>

See add_clip_full(), which also gives an error.

§clip

The clip to add

§Returns

true if clip was properly added to self, or false if self refused to add clip.

source

fn add_clip_full(&self, clip: &impl IsA<Clip>) -> Result<(), Error>

Adds the given clip to the layer. If the method succeeds, the layer will take ownership of the clip.

This method will fail and return false if clip already resides in some layer. It can also fail if the additional clip breaks some compositional rules (see TimelineElement).

§clip

The clip to add

§Returns

true if clip was properly added to self, or false if self refused to add clip.

source

fn is_active_for_track(&self, track: &impl IsA<Track>) -> bool

Gets whether the layer is active for the given track. See set_active_for_tracks().

§track

The Track to check if self is currently active for

§Returns

true if self is active for track, or false otherwise.

source

fn is_auto_transition(&self) -> bool

Gets the auto-transition of the layer.

§Returns

true if transitions are automatically added to self.

source

fn clips(&self) -> Vec<Clip>

Get the Clip-s contained in this layer.

§Returns

A list of clips in self.

source

fn clips_in_interval( &self, start: impl Into<Option<ClockTime>>, end: impl Into<Option<ClockTime>> ) -> Vec<Clip>

Gets the clips within the layer that appear between start and end.

§start

Start of the interval

§end

End of the interval

§Returns

A list of Clip-s that intersect the interval [start, end) in self.

source

fn duration(&self) -> ClockTime

Retrieves the duration of the layer, which is the difference between the start of the layer (always time 0) and the end (which will be the end time of the final clip).

§Returns

The duration of self.

source

fn priority(&self) -> u32

Get the priority of the layer. When inside a timeline, this is its index in the timeline. See TimelineExt::move_layer().

§Returns

The priority of self within its timeline.

source

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

Gets the timeline that the layer is a part of.

§Returns

The timeline that self is currently part of, or None if it is not associated with any timeline.

source

fn is_empty(&self) -> bool

Convenience method to check if the layer is empty (doesn’t contain any Clip), or not.

§Returns

true if self is empty, false if it contains at least one clip.

source

fn remove_clip(&self, clip: &impl IsA<Clip>) -> Result<(), BoolError>

Removes the given clip from the layer.

§clip

The clip to remove

§Returns

true if clip was removed from self, or false if the operation failed.

source

fn set_active_for_tracks(&self, active: bool, tracks: &[Track]) -> bool

Activate or deactivate track elements in tracks (or in all tracks if tracks is None).

When a layer is deactivated for a track, all the TrackElement-s in the track that belong to a Clip in the layer will no longer be active in the track, regardless of their individual active value.

Note that by default a layer will be active for all of its timeline’s tracks.

§active

Whether elements in tracks should be active or not

§tracks

The list of tracks self should be (de-)active in, or None to include all the tracks in the self’s timeline

§Returns

true if the operation worked false otherwise.

source

fn set_auto_transition(&self, auto_transition: bool)

Sets auto-transition for the layer. Use TimelineExt::set_auto_transition() if you want all layers within a Timeline to have auto-transition set to true. Use this method if you want different values for different layers (and make sure to keep auto-transition as false for the corresponding timeline).

§auto_transition

Whether transitions should be automatically added to the layer

source

fn set_priority(&self, priority: u32)

👎Deprecated: Since 1.16

Sets the layer to the given priority. See priority.

§Deprecated since 1.16

use ges_timeline_move_layer instead. This deprecation means that you will not need to handle layer priorities at all yourself, GES will make sure there is never ‘gaps’ between layer priorities.

§priority

The priority to set

source

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

source

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

Will be emitted after the clip is added to the layer.

§clip

The clip that was added

source

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

Will be emitted after the clip is removed from the layer.

§clip

The clip that was removed

source

fn connect_auto_transition_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.16

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<O: IsA<Layer>> LayerExt for O