pub trait Processor: Send {
// Required methods
fn prepare(&mut self, cfg: PrepareConfig);
fn reset(&mut self);
fn process(&mut self, block: &mut ProcessBlock<'_>);
// Provided methods
fn clock_domain(&self) -> ClockDomain { ... }
fn latency_class(&self) -> LatencyClass { ... }
fn realtime_pin(&self) -> bool { ... }
fn ports(&self, in_channels: u16, out_channels: u16) -> Vec<PortDecl> { ... }
fn descriptor(
&self,
in_channels: u16,
out_channels: u16,
) -> ProcessorDescriptor { ... }
fn tail_frames(&self) -> u64 { ... }
}Expand description
Required Methods§
Sourcefn prepare(&mut self, cfg: PrepareConfig)
fn prepare(&mut self, cfg: PrepareConfig)
Prepares the processor for a sample rate, block size, and channel layout.
Sourcefn process(&mut self, block: &mut ProcessBlock<'_>)
fn process(&mut self, block: &mut ProcessBlock<'_>)
Processes one block of audio and events in place.
Provided Methods§
Sourcefn clock_domain(&self) -> ClockDomain
fn clock_domain(&self) -> ClockDomain
Returns the processor’s clock domain (defaults to sample rate).
Sourcefn latency_class(&self) -> LatencyClass
fn latency_class(&self) -> LatencyClass
Returns the processor’s latency class (defaults to block-local).
Sourcefn realtime_pin(&self) -> bool
fn realtime_pin(&self) -> bool
Returns whether the processor must run in the realtime thread (defaults
to true).
Sourcefn ports(&self, in_channels: u16, out_channels: u16) -> Vec<PortDecl>
fn ports(&self, in_channels: u16, out_channels: u16) -> Vec<PortDecl>
Returns the processor’s port declarations for the given channel counts (defaults to a single audio in/out pair).
Sourcefn descriptor(&self, in_channels: u16, out_channels: u16) -> ProcessorDescriptor
fn descriptor(&self, in_channels: u16, out_channels: u16) -> ProcessorDescriptor
Returns the full ProcessorDescriptor assembled from this processor’s
clock, latency, pinning, and ports.
Sourcefn tail_frames(&self) -> u64
fn tail_frames(&self) -> u64
Returns the processor’s release tail length in frames (defaults to 0).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".