Skip to main content

Params

Trait Params 

Source
pub trait Params:
    Send
    + Sync
    + 'static {
Show 13 methods // Required methods fn param_infos(&self) -> Vec<ParamInfo>; fn count(&self) -> usize; fn get_normalized(&self, id: u32) -> Option<f64>; fn set_normalized(&self, id: u32, value: f64); fn get_plain(&self, id: u32) -> Option<f64>; fn set_plain(&self, id: u32, value: f64); fn format_value(&self, id: u32, value: f64) -> Option<String>; fn parse_value(&self, id: u32, text: &str) -> Option<f64>; fn snap_smoothers(&self); fn set_sample_rate(&self, sample_rate: f64); fn collect_values(&self) -> (Vec<u32>, Vec<f64>); fn restore_values(&self, values: &[(u32, f64)]); fn default_for_gui() -> Self where Self: Sized;
}
Expand description

Trait implemented by #[derive(Params)] on a struct. Format wrappers use this to enumerate, read, and write parameters.

Required Methods§

Source

fn param_infos(&self) -> Vec<ParamInfo>

All parameter infos, in declaration order.

Source

fn count(&self) -> usize

Number of parameters.

Source

fn get_normalized(&self, id: u32) -> Option<f64>

Get normalized value (0.0–1.0) by ID.

Source

fn set_normalized(&self, id: u32, value: f64)

Set normalized value (0.0–1.0) by ID.

Source

fn get_plain(&self, id: u32) -> Option<f64>

Get plain value by ID.

Source

fn set_plain(&self, id: u32, value: f64)

Set plain value by ID.

Source

fn format_value(&self, id: u32, value: f64) -> Option<String>

Format a plain value to display string.

Source

fn parse_value(&self, id: u32, text: &str) -> Option<f64>

Parse a display string to plain value.

Source

fn snap_smoothers(&self)

Reset all smoothers to current values.

Source

fn set_sample_rate(&self, sample_rate: f64)

Update smoother sample rates.

Source

fn collect_values(&self) -> (Vec<u32>, Vec<f64>)

Collect all parameter IDs and their current plain values.

Source

fn restore_values(&self, values: &[(u32, f64)])

Restore parameter values from a list of (id, value) pairs.

Source

fn default_for_gui() -> Self
where Self: Sized,

Create a default instance for GUI parameter display. The GUI reads values via atomic reads from this instance.

Implementors§