AUDIO
Source snapshot · 11 November 2026

API reference / ravet_plugin::export::ParameterCache

Struct ParameterCache 

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

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 get(&self, index: usize) -> f32

The value at a declaration index.

pub fn set(&self, index: usize, value: f32)

Store one canonical value at a declaration index.

pub fn read_into(&self, output: &mut [f32])

Copy every value into output, in declaration order.

pub fn restore(&self, values: &[f32])

Replace every value and increment the generation, so the audio thread resends all values to the processor.

pub fn generation(&self) -> u64

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AutoreleaseSafe for T
where T: ?Sized,

§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.