pub struct SongClock { /* private fields */ }Expand description
Smooth, monotonic song time for the XA song a Player is playing.
Implementations§
Source§impl SongClock
impl SongClock
Sourcepub const fn new(ticks_hz: u32) -> Self
pub const fn new(ticks_hz: u32) -> Self
A clock for a tick counter running at ticks_hz (60 NTSC, 50 PAL).
Sourcepub const fn with_head_lead_ms(self, ms: i32) -> Self
pub const fn with_head_lead_ms(self, ms: i32) -> Self
Subtract ms from every reading: how far the drive head is ahead of
the sound you hear. Measured on a console, not derived (see the module
docs); negative moves the other way. Also the place for a
player-facing audio latency setting.
Sourcepub fn update(&mut self, player: &Player, now_tick: u32) -> Option<u32>
pub fn update(&mut self, player: &Player, now_tick: u32) -> Option<u32>
Song time in milliseconds at now_tick, from the newest reading
player holds. Call it every tick, after Player::poll. None
while the song is not streaming (starting, seeking after a loop or a
resume, suspended, stopped); the clock restarts from the first
reading of each new run.