Struct Parameter Cache
pub struct ParameterCache { /* private fields */ }Expand description
Current physical parameter values, shared by the main thread, the audio thread and the editor. Lock-free and allocation-free after construction.
The main thread writes values when the host sets them, when state loads and when the editor edits them, so saved state is always current. The audio thread writes values it receives as automation. A restore increments the generation, which tells the audio thread to resend every value to the processor.
Implementations§
§impl ParameterCache
impl ParameterCache
pub fn new(product: &ResolvedProduct<'_>) -> Self
pub fn new(product: &ResolvedProduct<'_>) -> Self
A cache holding the product’s defaults.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn restore(&self, values: &[f32])
pub fn restore(&self, values: &[f32])
Replace every value and increment the generation, so the audio thread resends all values to the processor.