Struct Mono Duplicator
pub struct MonoDuplicator<S: GraphSample, C, K: SharedMonoKernel<S, C>> { /* private fields */ }Expand description
One prepared control object shared by reference and 1..64 separate native histories. The factory returns inactive kernels; successful kernels may own additional caller-defined storage outside the checked 4MiB kernel-Vec payload cap. Effect-only, no events/auxiliary/generated events; construction/preparation are CONTROL. Bypass returns exact dry input and freezes all histories.
Rendering paths: Processor::process validates the whole block and, on a
refusal, silences the active output frames (backing tails and histories are
untouched); process_sample, process_frame, process_planar and
process_in_place preflight the whole call and return an error without writing
outputs or advancing any kernel. Nonfinite samples are passed to the kernels and
through bypass unchanged; what a kernel makes of them (including leaking into
its own history) is the kernel’s policy.
prepare deactivates first, so a refused or failed prepare leaves the
duplicator unprepared; kernel histories are whatever the foreign kernels keep
across deactivation. Dropping an active duplicator deactivates the prepared
kernel prefix once, in reverse order, before the kernels are dropped.
prepare_failure() is cleared only by the next prepare, not by
deactivate or shared_controls_mut_stopped.
Implementations§
§impl<S: GraphSample, C, K: SharedMonoKernel<S, C>> MonoDuplicator<S, C, K>
impl<S: GraphSample, C, K: SharedMonoKernel<S, C>> MonoDuplicator<S, C, K>
pub fn new<F, E>(
controls: C,
channels: usize,
maximum_frames: usize,
factory: F,
) -> Result<Self, MonoFactoryFailure<C, K, F, E>>
pub fn new<F, E>( controls: C, channels: usize, maximum_frames: usize, factory: F, ) -> Result<Self, MonoFactoryFailure<C, K, F, E>>
The allocator-failure branch of the kernel reservation and the post- reservation capacity check cannot be reached by ordinary tests (an exact reservation of at most the admitted payload); they are defensive refusals without dedicated coverage.
pub fn channels(&self) -> usize
Invalidates preparation first; changing controls requires reprepare.
pub fn kernel(&self, channel: usize) -> Option<&K>
pub fn prepare_failure(&self) -> Option<(usize, PrepareError)>
pub fn prepare_failure(&self) -> Option<(usize, PrepareError)>
Index and error of the last failed kernel prepare. Cleared by the next
prepare only; deactivate and shared_controls_mut_stopped keep it.
pub fn set_bypassed(&mut self, value: bool)
pub fn is_bypassed(&self) -> bool
pub fn process_sample( &mut self, channel: usize, input: S, ) -> Result<S, ProcessError>
pub fn process_frame( &mut self, input: &[S], output: &mut [S], ) -> Result<(), ProcessError>
pub fn process_planar( &mut self, inputs: &[&[S]], outputs: &mut [&mut [S]], frames: usize, ) -> Result<(), ProcessError>
pub fn process_in_place( &mut self, channels: &mut [&mut [S]], frames: usize, ) -> Result<(), ProcessError>
pub fn into_parts(self) -> (C, Vec<K>)
pub fn into_parts(self) -> (C, Vec<K>)
CONTROL-only owner recovery after once-only deactivation.
Trait Implementations§
§impl<S: GraphSample, C, K: SharedMonoKernel<S, C>> Drop for MonoDuplicator<S, C, K>
impl<S: GraphSample, C, K: SharedMonoKernel<S, C>> Drop for MonoDuplicator<S, C, K>
§impl<S: GraphSample, C, K: SharedMonoKernel<S, C>> Processor<S> for MonoDuplicator<S, C, K>
impl<S: GraphSample, C, K: SharedMonoKernel<S, C>> Processor<S> for MonoDuplicator<S, C, K>
§fn prepare(&mut self, c: ProcessConfig) -> Result<(), PrepareError>
fn prepare(&mut self, c: ProcessConfig) -> Result<(), PrepareError>
Deactivates first. A kernel prepare panic leaves the successfully
prepared prefix active; it is deactivated once, in reverse, by the next
deactivate, prepare or by Drop, including during unwinding.
§fn latency_samples(&self) -> u32
fn latency_samples(&self) -> u32
Maximum over kernels while prepared, else zero. Kernels are not summed; bypass does not change the declared value.
§fn tail(&self) -> Tail
fn tail(&self) -> Tail
Longest kernel tail while prepared (Infinite dominates, None is the
identity), else Tail::None.