pub struct MusicCapture { /* private fields */ }Expand description
Control-thread reader for synthesis register writes applied by the audio engine.
Poll Self::try_finish regularly to drain the bounded queue. Capture includes
manual, prepared and live OPL writes and note releases at their actual output
times. It records registers rather than PCM: fades, post-chip gain, analog
mixing, MIDI and PC speaker operations are not representable in DRO.
Start before programming instruments for a self-contained replay.
Stopping is acknowledged at an output-frame boundary. Keep rendering until
Self::is_finished becomes true, then collect the result on this thread.
Overflow permanently invalidates the capture and is reported explicitly.
Dropping this reader requests a stop; callback-owned resources remain owned
by the engine until it is safely dropped or reconfigured outside rendering.
Implementations§
Source§impl MusicCapture
impl MusicCapture
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Whether the callback has acknowledged stop or capture overflow.
Sourcepub fn is_overflowed(&self) -> bool
pub fn is_overflowed(&self) -> bool
Whether the bounded queue has lost an event, invalidating this capture.
Sourcepub fn try_finish(&mut self) -> Result<Option<Capture>>
pub fn try_finish(&mut self) -> Result<Option<Capture>>
Drain pending writes on this thread and take an acknowledged capture once.
Returns None until a frame boundary acknowledges stop, and after the
result has been consumed. Queue overflow returns Error::CaptureOverflow
once instead of a truncated capture. All conversion allocations occur here.