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

PlaybackStarter

Struct PlaybackStarter 

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

Poll-driven CD-DA start handshake (SetMode -> Demute -> Play).

ⓘ
let mut starter = PlaybackStarter::new();
starter.begin(tick); // arms the cold-drive delay
// then, once per tick:
if starter.tick(tick, track) {
    // playback accepted this tick; e.g. clock.start(tick)
}

Implementations§

Source§

impl PlaybackStarter

Source

pub const fn new() -> Self

A starter in the Done state; call PlaybackStarter::begin to arm it.

Source

pub const fn with_spins(self, spins: u32) -> Self

Override the per-command spin budget (emulators answer instantly; silicon wants the default).

Source

pub const fn with_retry_ticks(self, ticks: u32) -> Self

Override the delay after a rejected command. Successful steps retain their two-tick controller settling gap.

Source

pub fn begin_after(&mut self, now_tick: u32, delay: u32)

Arm with an explicit initial delay (zero for an already warm drive).

Source

pub fn begin(&mut self, now_tick: u32)

Arm the handshake: first command fires COLD_DRIVE_DELAY_TICKS after now_tick.

Source

pub fn has_started(&self) -> bool

Whether Play has been accepted (the handshake is finished).

Source

pub fn step_code(&self) -> u8

Which handshake step is pending, for on-screen diagnostics: 0 SetMode, 1 Demute, 2 Play, 3 Done. Note that Done means Play was ACCEPTED, not that the head has arrived; the drive may still be seeking when this reads 3.

Source

pub fn tick_on(&mut self, cd: &mut Cd, now_tick: u32, track: u8) -> bool

Drive one attempt if due, issuing its command through cd. Returns true exactly once, on the tick the Play command is accepted. Safe to keep calling afterwards (no-op).

Source§

impl PlaybackStarter

Source

pub fn tick(&mut self, now_tick: u32, track: u8) -> bool

👎Deprecated:

use tick_on with the Cd token

tick_on on a token the caller does not hold.

Source

pub fn started(&self) -> bool

👎Deprecated:

renamed to has_started

Renamed to Self::has_started.

Trait Implementations§

Source§

impl Clone for PlaybackStarter

Source§

fn clone(&self) -> PlaybackStarter

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PlaybackStarter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PlaybackStarter

Source§

fn default() -> Self

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

impl Copy for PlaybackStarter

Auto Trait Implementations§

§

impl Freeze for PlaybackStarter

§

impl RefUnwindSafe for PlaybackStarter

§

impl Send for PlaybackStarter

§

impl Sync for PlaybackStarter

§

impl Unpin for PlaybackStarter

§

impl UnsafeUnpin for PlaybackStarter

§

impl UnwindSafe for PlaybackStarter

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> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.