pub trait LayerExt: IsA<Layer> + '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 { ... }
}Provided Methods§
Sourcefn 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( &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.
Sourcefn 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_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.
Sourcefn add_clip(&self, clip: &impl IsA<Clip>) -> Result<(), BoolError>
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.
Sourcefn add_clip_full(&self, clip: &impl IsA<Clip>) -> Result<(), Error>
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.
Sourcefn is_active_for_track(&self, track: &impl IsA<Track>) -> bool
fn is_active_for_track(&self, track: &impl IsA<Track>) -> bool
Sourcefn is_auto_transition(&self) -> bool
fn is_auto_transition(&self) -> bool
Gets the auto-transition of the layer.
§Returns
true if transitions are automatically added to self.
Sourcefn clips_in_interval(
&self,
start: impl Into<Option<ClockTime>>,
end: impl Into<Option<ClockTime>>,
) -> Vec<Clip>
fn clips_in_interval( &self, start: impl Into<Option<ClockTime>>, end: impl Into<Option<ClockTime>>, ) -> Vec<Clip>
Sourcefn duration(&self) -> ClockTime
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.
Sourcefn priority(&self) -> u32
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.
Sourcefn set_active_for_tracks(&self, active: bool, tracks: &[Track]) -> bool
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
Sourcefn set_auto_transition(&self, auto_transition: bool)
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
Sourcefn set_priority(&self, priority: u32)
👎Deprecated: Since 1.16
fn set_priority(&self, priority: u32)
fn set_timeline(&self, timeline: &impl IsA<Timeline>)
Sourcefn connect_clip_added<F: Fn(&Self, &Clip) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_clip_added<F: Fn(&Self, &Clip) + 'static>( &self, f: F, ) -> SignalHandlerId
Sourcefn connect_clip_removed<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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.