pub struct PlaybackClock { /* private fields */ }Expand description
Audio-anchored song clock: GetlocP anchor + tick interpolation.
Feed it your per-display-frame tick counter (the same one you pass to
PlaybackStarter); construct with that counter’s rate (60 for NTSC, 50 for
PAL). Output is milliseconds into the playing track, smooth every tick,
monotonic (never steps backwards), and immune to single-sample GetlocP
jitter while still following a genuine seek or track loop.
Implementations§
Source§impl PlaybackClock
impl PlaybackClock
Sourcepub const fn new(ticks_hz: u32) -> Self
pub const fn new(ticks_hz: u32) -> Self
A stopped clock counting ticks_hz ticks per second (60 NTSC, 50 PAL).
Sourcepub fn start(&mut self, now_tick: u32)
pub fn start(&mut self, now_tick: u32)
Call once CD-DA playback has actually started (e.g. on the tick
PlaybackStarter::tick returns true).
Sourcepub fn is_playing(&self) -> bool
pub fn is_playing(&self) -> bool
Whether PlaybackClock::start has been called.