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: f32Pixels per second.
scroll_x: f64Horizontal scroll in seconds at the left edge of the lanes.
scroll_y: f32Vertical scroll in points.
header_w: f32Width of the header column in points.
lanes_rect: RectContent 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: boolThe 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: f32Subtitle 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
impl TimelineState
pub fn x_at(&self, t: f64) -> f32
Sourcepub fn track_at(&self, y: f32, project: &Project) -> Option<usize>
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).
Sourcepub fn zoom_to_fit(&mut self, duration: f64, avail_w: f32)
pub fn zoom_to_fit(&mut self, duration: f64, avail_w: f32)
Fit [0, duration] into avail_w points.
Sourcepub fn zoom_by(&mut self, factor: f32, anchor_x: Option<f32>)
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.
Sourcepub fn follow_playhead(&mut self, t: f64)
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.
pub fn ensure_visible(&mut self, t: f64)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TimelineState
impl RefUnwindSafe for TimelineState
impl Send for TimelineState
impl Sync for TimelineState
impl Unpin for TimelineState
impl UnwindSafe for TimelineState
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> 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