pub struct AsioBufferSwitchBridge<P> { /* private fields */ }Expand description
Drives a processor from an ASIO-style buffer switch callback.
Implementations§
Source§impl<P: Processor> AsioBufferSwitchBridge<P>
impl<P: Processor> AsioBufferSwitchBridge<P>
Sourcepub fn new(
processor: P,
timing: AsioTiming,
input_channels: usize,
output_channels: usize,
) -> Result<Self>
pub fn new( processor: P, timing: AsioTiming, input_channels: usize, output_channels: usize, ) -> Result<Self>
Builds a bridge over processor, calling its prepare with the timing’s
sample rate, buffer size, and channel counts, and sizing scratch for the
wider of the input/output lane counts.
Returns an error if both channel counts are zero, the buffer size does
not fit in u32, or either channel count does not fit in u16.
Sourcepub fn process_planar_f32(
&mut self,
input: Option<&[&[f32]]>,
frames: usize,
) -> Result<Vec<Vec<f32>>>
pub fn process_planar_f32( &mut self, input: Option<&[&[f32]]>, frames: usize, ) -> Result<Vec<Vec<f32>>>
Runs one buffer switch: wraps the planar f32 input (or silence when
None) and frames count into a ProcessBlock, validates lanes, runs
the processor, advances the sample position, and returns the planar
output lanes.
Returns an error if frames exceeds the prepared maximum block size or
the supplied input does not match the configured channel count and frame
length.
Sourcepub fn sample_pos(&self) -> u64
pub fn sample_pos(&self) -> u64
Returns the number of frames processed since construction or the last
reset.
Sourcepub fn timing(&self) -> AsioTiming
pub fn timing(&self) -> AsioTiming
Returns the timing this bridge was constructed with.