Struct Policy Processor
pub struct PolicyProcessor<P> { /* private fields */ }Expand description
Wraps a processor in a product’s AutomationPolicy and BypassPolicy.
Preparation allocates event scratch, generated-event scratch, for
BypassPolicy::Hard and BypassPolicy::Crossfade one dry copy per
output channel plus a gain ramp, and for every policy except
BypassPolicy::Processor a dry delay line per output channel when the
processor has (or may have) latency; BypassPolicy::Frozen then also
keeps a dry copy per channel. Processing and reset never allocate. With
the default policies the wrapper forwards blocks unchanged.
Implementations§
§impl<P> PolicyProcessor<P>
impl<P> PolicyProcessor<P>
pub fn new(processor: P, product: &ResolvedProduct<'_>) -> Self
pub fn new(processor: P, product: &ResolvedProduct<'_>) -> Self
Wrap processor in the policies of product.
pub fn with_policies(
processor: P,
automation: AutomationPolicy,
bypass: BypassPolicy,
bypass_id: Option<ParameterId>,
) -> Self
pub fn with_policies( processor: P, automation: AutomationPolicy, bypass: BypassPolicy, bypass_id: Option<ParameterId>, ) -> Self
Wrap processor with explicit policies. bypass_id is the bypass
parameter; without one, the bypass policy falls back to
BypassPolicy::Processor.
pub fn with_maximum_latency(self, samples: u32) -> Self
pub fn with_maximum_latency(self, samples: u32) -> Self
Size the dry delay for at least samples of latency (clamped to
MAXIMUM_BYPASS_LATENCY) from the next prepare; see
Product::with_maximum_latency.
pub fn processor(&self) -> &P
pub fn processor_mut(&mut self) -> &mut P
pub fn is_bypassed(&self) -> bool
pub fn is_bypassed(&self) -> bool
Whether the latest bypass event requested bypass. Always false for
BypassPolicy::Processor.