Skip to main content
← PSoXide SDK guides and examples · SDK 80d1c329e977 · All Cargo features enabled; check feature gates before use.

SongClock

Struct SongClock 

Source
pub struct SongClock { /* private fields */ }
Expand description

Smooth, monotonic song time for the XA song a Player is playing.

Implementations§

Source§

impl SongClock

Source

pub const fn new(ticks_hz: u32) -> Self

A clock for a tick counter running at ticks_hz (60 NTSC, 50 PAL).

Source

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.

Source

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.

Auto Trait Implementations§

§

impl Freeze for SongClock

§

impl RefUnwindSafe for SongClock

§

impl Send for SongClock

§

impl Sync for SongClock

§

impl Unpin for SongClock

§

impl UnsafeUnpin for SongClock

§

impl UnwindSafe for SongClock

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.