Struct Prepared Output
pub struct PreparedOutput<P: Processor> { /* private fields */ }Expand description
Prepared output-only f32 rendering, independently testable without hardware. Construction may allocate; render uses bounded scratch without allocation. Processor implementations must obey the portable callback contract.
Implementations§
§impl<P: Processor> PreparedOutput<P>
impl<P: Processor> PreparedOutput<P>
pub fn new(
processor: P,
sample_rate: u32,
channels: usize,
maximum_frames: usize,
) -> Result<Self, PrepareError>
pub fn new( processor: P, sample_rate: u32, channels: usize, maximum_frames: usize, ) -> Result<Self, PrepareError>
Prepare 1..=64 output channels and 1..=65,536 scratch frames per channel. Input/events/auxiliary capacities are zero. A failed prepare must leave the supplied processor inactive, as required by Processor.
pub fn new_owned(
processor: P,
sample_rate: u32,
channels: usize,
maximum_frames: usize,
) -> Result<Self, PreparedOutputFailure<P>>
pub fn new_owned( processor: P, sample_rate: u32, channels: usize, maximum_frames: usize, ) -> Result<Self, PreparedOutputFailure<P>>
Prepare off callback while returning the original processor on ordinary failure. Scratch is fallibly allocated before Processor::prepare, so a scratch allocation failure does not mutate the processor. A failed foreign prepare must obey Processor’s inactive contract; foreign panic is exceptional.
pub fn into_processor(self) -> P
pub fn into_processor(self) -> P
Consume a directly owned stopped renderer on control, deactivate its processor once and return that original owner. Scratch/counters retire on the calling control thread. Reopening requires explicit preparation; no reader seek/reset is hidden here. A foreign deactivation panic is exceptional.
pub fn render(&mut self, output: &mut [f32])
pub fn render(&mut self, output: &mut [f32])
Fill an interleaved device buffer, partitioning oversized callbacks. A malformed partial frame silences the entire buffer without invoking DSP or advancing its position. Processor faults silence that sub-block. Silence status is enforced even if a processor left nonzero samples. Panics are contained by the live adapter, not this offline method.