pub struct Timeline<'a> { /* private fields */ }Expand description
A timeline drawn over a TimelineState the application keeps.
Implementations§
Source§impl<'a> Timeline<'a>
impl<'a> Timeline<'a>
pub fn new(state: &'a mut TimelineState) -> Self
Sourcepub fn id(self, id: impl Into<String>) -> Self
pub fn id(self, id: impl Into<String>) -> Self
Its name for agents (the timeline collector, the timeline.*
commands’ timeline) and its key in the context. Without one, it is
keyed by its place in the Ui, and agents do not see it.
Sourcepub fn label(self, label: impl Into<String>) -> Self
pub fn label(self, label: impl Into<String>) -> Self
Its accessible name, instead of “Timeline”.
Sourcepub fn lanes(self, height: f32) -> Self
pub fn lanes(self, height: f32) -> Self
The height of the lanes under the tracks (by default, a control’s height without tracks, none with some).
pub fn snap(self, snap: Snap) -> Self
Sourcepub fn history(self, path: impl Into<String>) -> Self
pub fn history(self, path: impl Into<String>) -> Self
Keeps the document’s part (markers, range, loop) as text at path of
the application’s value store, declared there if it is not: each
change is one step of its history, and an undo puts the document
back. Needs app.
Sourcepub fn surface(self, surface: &'a str) -> Self
pub fn surface(self, surface: &'a str) -> Self
The focus surface around it, for key bindings (SURFACE by
default).
Sourcepub fn take_focus(self, on: bool) -> Self
pub fn take_focus(self, on: bool) -> Self
It takes the keyboard focus this pass.
Sourcepub fn follow(self, on: bool) -> Self
pub fn follow(self, on: bool) -> Self
While it plays, the view follows the playhead a page at a time (on
by default): Follow::Page, else Follow::Off.
Sourcepub fn follow_mode(self, follow: Follow) -> Self
pub fn follow_mode(self, follow: Follow) -> Self
How the view follows the playhead (Follow::Page by default);
Follow::Fixed keeps the playhead in place and scrolls the content
under it.
Sourcepub fn scrub_on_drag(self, on: bool) -> Self
pub fn scrub_on_drag(self, on: bool) -> Self
A drag on a clip scrubs as a drag on the lanes does, instead of
moving or trimming it (off by default): the clips are locked to the
pointer, still selected by a click. With Follow::Fixed, the
content follows the pointer and the playhead stays.
Sourcepub fn nudge_on_drag(self, on: bool) -> Self
pub fn nudge_on_drag(self, on: bool) -> Self
While it plays, a drag on the ruler or the lanes (and the clips with
scrub_on_drag) nudges instead of scrubbing
(off by default): it adds NUDGE_GAIN of its own speed to the
playing, dragging the content forward (to the left) speeding up and
back slowing down, as a jog wheel’s edge does; released, the playing
goes on at its speed. Play and speed are not changed.
Sourcepub fn track_height(self, height: f32) -> Self
pub fn track_height(self, height: f32) -> Self
A track’s height unless the track says (by default, twice a control’s).
Sourcepub fn clips(self, painter: &'a mut dyn ClipPainter) -> Self
pub fn clips(self, painter: &'a mut dyn ClipPainter) -> Self
What draws the clips’ content (PlainClips, their labels, by
default).
Sourcepub fn show(self, ui: &mut Ui) -> TimelineOutput
pub fn show(self, ui: &mut Ui) -> TimelineOutput
Draws it, its lanes empty.
Sourcepub fn show_with(
self,
ui: &mut Ui,
lanes: impl FnOnce(&mut Ui, &Lanes),
) -> TimelineOutput
pub fn show_with( self, ui: &mut Ui, lanes: impl FnOnce(&mut Ui, &Lanes), ) -> TimelineOutput
Draws it, lanes drawing what goes under the ruler (rows of data, a
beat grid) before the clips, the markers and the playhead are drawn
over it.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Timeline<'a>
impl<'a> !RefUnwindSafe for Timeline<'a>
impl<'a> !Send for Timeline<'a>
impl<'a> !Sync for Timeline<'a>
impl<'a> Unpin for Timeline<'a>
impl<'a> UnsafeUnpin for Timeline<'a>
impl<'a> !UnwindSafe for Timeline<'a>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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