Struct TimelineState

Source
pub struct TimelineState {
Show 15 fields pub zoom: f32, pub scroll_x: f64, pub scroll_y: f32, pub header_w: f32, pub lanes_rect: Rect, drag: Option<Drag>, user_panned: bool, band: Option<(Pos2, bool)>, pub selected_marker: Option<u64>, rename: Option<(u64, String)>, pub last_track: Option<usize>, pub sub_h: f32, pub sub_sel: Vec<u64>, sub_band: Option<(f64, bool)>, sub_trim: Option<(u64, bool)>,
}

Fields§

§zoom: f32

Pixels per second.

§scroll_x: f64

Horizontal scroll in seconds at the left edge of the lanes.

§scroll_y: f32

Vertical scroll in points.

§header_w: f32

Width of the header column in points.

§lanes_rect: Rect

Content rect (lanes area, excluding header & ruler) from the last frame — used by the app for file drops.

§drag: Option<Drag>

Active move/trim gesture.

§user_panned: bool

The user panned/zoomed while playing: stop following the playhead until it is back in view.

§band: Option<(Pos2, bool)>

Rubber band in progress: (press origin, add to the selection instead of replacing it).

§selected_marker: Option<u64>

Marker picked by the last click (drawn highlighted).

§rename: Option<(u64, String)>

Rename buffer for the marker context menu.

§last_track: Option<usize>

Track under the last press on the lanes — where Ctrl+V pastes. ponytail: an index, not an id, so removing a track just makes the next paste land on its neighbour.

§sub_h: f32

Subtitle lane height (Alt+scroll over the lane resizes it, like tracks).

§sub_sel: Vec<u64>

Selected cues on the subtitle lane (band drag / Ctrl+click) — bulk convert/delete targets.

§sub_band: Option<(f64, bool)>

Band-select in progress on the subtitle lane: press-origin time and “Shift held” (add to selection).

§sub_trim: Option<(u64, bool)>

Cue edge being trimmed on the subtitle lane: (cue id, right edge?).

Implementations§

Source§

impl TimelineState

Source

pub fn time_at(&self, x: f32) -> f64

Timeline time at an absolute x position (points).

Source

pub fn x_at(&self, t: f64) -> f32

Source

pub fn track_at(&self, y: f32, project: &Project) -> Option<usize>

Track index under an absolute y position (points), given the project (for track heights).

Source

pub fn zoom_to_fit(&mut self, duration: f64, avail_w: f32)

Fit [0, duration] into avail_w points.

Source

pub fn zoom_by(&mut self, factor: f32, anchor_x: Option<f32>)

Multiply zoom, keeping the time under anchor_x (absolute points) fixed if given.

Source

pub fn follow_playhead(&mut self, t: f64)

Scroll so t is visible (used when the playhead runs off-screen while playing). Suspended after a user pan until t is back in view. Scroll t into view unconditionally (an explicit seek: Home/End, prev/next cut, a subtitle click, an MCP playback.seek). Unlike ensure_visible a previous user pan does not suppress it.

Source

pub fn ensure_visible(&mut self, t: f64)

Trait Implementations§

Source§

impl Default for TimelineState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

§

impl<T> MaybeSend for T

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,