pub struct TimelineViewState {
pub view_start: f64,
pub view_end: f64,
pub scroll_y: f32,
pub track_heights: HashMap<u64, f32>,
pub zoom_level: f32,
pub snap_mode: SnapMode,
pub show_waveforms: bool,
pub show_thumbnails: bool,
pub collapsed_groups: HashSet<u64>,
}Fields§
§view_start: f64§view_end: f64§scroll_y: f32§track_heights: HashMap<u64, f32>§zoom_level: f32§snap_mode: SnapMode§show_waveforms: bool§show_thumbnails: bool§collapsed_groups: HashSet<u64>Implementations§
Source§impl TimelineViewState
impl TimelineViewState
pub fn new(duration: f64) -> Self
pub fn time_to_screen_x(&self, time: f64, screen_w: f32) -> f32
pub fn screen_x_to_time(&self, x: f32, screen_w: f32) -> f64
pub fn snap_time(&self, time: f64, fps: f32) -> f64
pub fn zoom_in(&mut self, center: f64, factor: f32)
pub fn zoom_out(&mut self, center: f64, factor: f32, duration: f64)
pub fn pan(&mut self, delta_time: f64, duration: f64)
pub fn track_height(&self, track_id: u64) -> f32
pub fn visible_time_range(&self) -> (f64, f64)
Trait Implementations§
Source§impl Clone for TimelineViewState
impl Clone for TimelineViewState
Auto Trait Implementations§
impl Freeze for TimelineViewState
impl RefUnwindSafe for TimelineViewState
impl Send for TimelineViewState
impl Sync for TimelineViewState
impl Unpin for TimelineViewState
impl UnsafeUnpin for TimelineViewState
impl UnwindSafe for TimelineViewState
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.