pub struct Selection { /* private fields */ }Expand description
Manages the current selection state for timeline editing.
A Selection tracks three orthogonal selection types:
- Ranges – time spans on the timeline ruler.
- Clips – individual clip IDs.
- Tracks – track indices.
Implementations§
Source§impl Selection
impl Selection
Sourcepub fn select_range(&mut self, range: SelectionRange, mode: SelectionMode)
pub fn select_range(&mut self, range: SelectionRange, mode: SelectionMode)
Applies range to the time-range selection using mode.
Sourcepub fn merge_overlapping_ranges(&mut self)
pub fn merge_overlapping_ranges(&mut self)
Merges all overlapping or adjacent ranges in self.ranges.
Sourcepub fn selected_duration(&self) -> u64
pub fn selected_duration(&self) -> u64
Returns the total duration covered by all selected ranges.
Sourcepub fn ranges(&self) -> &[SelectionRange]
pub fn ranges(&self) -> &[SelectionRange]
Returns a slice of the currently selected ranges.
Sourcepub fn select_clip(&mut self, id: u64, mode: SelectionMode)
pub fn select_clip(&mut self, id: u64, mode: SelectionMode)
Applies id to the clip selection using mode.
Sourcepub fn is_clip_selected(&self, id: u64) -> bool
pub fn is_clip_selected(&self, id: u64) -> bool
Returns true if the clip with id is currently selected.
Sourcepub fn selected_clips(&self) -> &[u64]
pub fn selected_clips(&self) -> &[u64]
Returns a slice of all currently selected clip IDs.
Sourcepub fn select_all_in_range(
&mut self,
clips: &[TimelineClipRef],
range: SelectionRange,
)
pub fn select_all_in_range( &mut self, clips: &[TimelineClipRef], range: SelectionRange, )
Selects all clips from clips whose time span overlaps range.
Sourcepub fn select_track(&mut self, track: u32, mode: SelectionMode)
pub fn select_track(&mut self, track: u32, mode: SelectionMode)
Selects the track with the given index using mode.
Sourcepub fn is_track_selected(&self, index: u32) -> bool
pub fn is_track_selected(&self, index: u32) -> bool
Returns true if the track with index is currently selected.
Sourcepub fn selected_tracks(&self) -> &[u32]
pub fn selected_tracks(&self) -> &[u32]
Returns a slice of all currently selected track indices.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Selection
impl RefUnwindSafe for Selection
impl Send for Selection
impl Sync for Selection
impl Unpin for Selection
impl UnsafeUnpin for Selection
impl UnwindSafe for Selection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more