pub struct CddaPlayer {Show 16 fields
pub disc: Option<Rc<Disc>>,
pub good_status_due: u32,
pub status: Status,
pub start: i64,
pub end: i64,
pub end_mode: EndMode,
pub anchor_clock: i64,
pub anchor_sample: i64,
pub event_at: Option<i64>,
pub now: i64,
pub taken: i64,
pub take_origin: Option<i64>,
pub fader: Rc<Cell<Fader>>,
pub gain: f64,
pub paused_after_seek: bool,
pub subq_status: [u8; 4],
/* private fields */
}Fields§
§disc: Option<Rc<Disc>>§good_status_due: u32The bus owes this many good_status() (the reference’s on_good_status callback).
status: Status§start: i64§end: i64§end_mode: EndMode§anchor_clock: i64§anchor_sample: i64absolute sample number (sector * 588 + offset) at the anchor
event_at: Option<i64>seek done, or the end of the range
now: i64§taken: i64samples handed out so far, in absolute stream time
take_origin: Option<i64>§fader: Rc<Cell<Fader>>§gain: f64AudioSource socket: the mixer’s gain for this source
paused_after_seek: bool§subq_status: [u8; 4][emu: Mednafen DoNEC_PCE_READSUBQ, tier 5] the audio-status byte of READ SUBQ, for
playing, paused, stopped, seeking (the reference’s SUBQ_STATUS)
Implementations§
Source§impl CddaPlayer
impl CddaPlayer
pub fn new() -> CddaPlayer
pub fn active(&self) -> bool
pub fn status_code(&self) -> u8
Sourcepub fn play(&mut self, start: i64, paused: bool, seek_clocks: i64)
pub fn play(&mut self, start: i64, paused: bool, seek_clocks: i64)
AUDIO START: seek to start, then play to the end of its track (or wait for an AUDIO
END if paused). The bus holds BUSY until the seek is done.
Sourcepub fn set_end(&mut self, end: i64, mode: u8)
pub fn set_end(&mut self, end: i64, mode: u8)
AUDIO END (modes 1-3): play (or resume) up to sector end inclusive.
pub fn pause(&mut self)
pub fn stop(&mut self)
pub fn next_event(&self) -> Option<i64>
Sourcepub fn run_to(&mut self, mclk: i64)
pub fn run_to(&mut self, mclk: i64)
Fire the seek-done and end-of-range events due at or before mclk.
Sourcepub fn latest_sample(&mut self) -> (i16, i16)
pub fn latest_sample(&mut self) -> (i16, i16)
The sample being played at the last time run ($1805/$1806): zeros unless playing.
Sourcepub fn fade_gain(&self, mclk: i64, adpcm: bool) -> f64
pub fn fade_gain(&self, mclk: i64, adpcm: bool) -> f64
The fader’s gain (the reference’s fade_gain).
pub fn fade_register(&self) -> u8
Sourcepub fn write_fade(&mut self, value: u8, mclk: i64)
pub fn write_fade(&mut self, value: u8, mclk: i64)
$180F [hw: pcetech 8]: bit 3 fades, bit 2 chooses the fast fade, bit 1 aims it at
ADPCM. Rewriting the same value changes nothing; a new value restarts the timer (the
finer cases in pcetech, a cancelled fade whose timer still runs, are U9).
Trait Implementations§
Source§impl AudioSource for CddaPlayer
impl AudioSource for CddaPlayer
Source§fn rate_hz(&self) -> f64
fn rate_hz(&self) -> f64
AudioSource attributes (socket 9): a fixed rate; the mixer applies gain
Source§fn take_samples(&mut self, mclk: i64) -> Vec<(i32, i32)>
fn take_samples(&mut self, mclk: i64) -> Vec<(i32, i32)>
Stereo samples since the last call, one per 1/44100 s of master-clock time (zeros when not playing, so a mixer keeps its place). The fader’s gain is applied.