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§
Sourcefn param_infos(&self) -> Vec<ParamInfo>
fn param_infos(&self) -> Vec<ParamInfo>
All parameter infos, in declaration order.
Sourcefn get_normalized(&self, id: u32) -> Option<f64>
fn get_normalized(&self, id: u32) -> Option<f64>
Get normalized value (0.0–1.0) by ID.
Sourcefn set_normalized(&self, id: u32, value: f64)
fn set_normalized(&self, id: u32, value: f64)
Set normalized value (0.0–1.0) by ID.
Sourcefn format_value(&self, id: u32, value: f64) -> Option<String>
fn format_value(&self, id: u32, value: f64) -> Option<String>
Format a plain value to display string.
Sourcefn parse_value(&self, id: u32, text: &str) -> Option<f64>
fn parse_value(&self, id: u32, text: &str) -> Option<f64>
Parse a display string to plain value.
Sourcefn snap_smoothers(&self)
fn snap_smoothers(&self)
Reset all smoothers to current values.
Sourcefn set_sample_rate(&self, sample_rate: f64)
fn set_sample_rate(&self, sample_rate: f64)
Update smoother sample rates.
Sourcefn collect_values(&self) -> (Vec<u32>, Vec<f64>)
fn collect_values(&self) -> (Vec<u32>, Vec<f64>)
Collect all parameter IDs and their current plain values.
Sourcefn restore_values(&self, values: &[(u32, f64)])
fn restore_values(&self, values: &[(u32, f64)])
Restore parameter values from a list of (id, value) pairs.
Sourcefn default_for_gui() -> Selfwhere
Self: Sized,
fn default_for_gui() -> Selfwhere
Self: Sized,
Create a default instance for GUI parameter display. The GUI reads values via atomic reads from this instance.