pub struct Parameter {
pub id: u32,
pub name: String,
pub value: f64,
pub min: f64,
pub max: f64,
pub default: f64,
pub unit: String,
pub step_count: i32,
pub can_automate: bool,
pub is_read_only: bool,
pub is_bypass: bool,
pub flags: u32,
}Expand description
Plugin parameter information
Fields§
§id: u32Parameter ID
name: StringParameter name
value: f64Current normalized value (0.0 to 1.0)
min: f64Minimum value in normalized space (VST3 parameters are always 0.0..=1.0;
the plain/engineering range is private to the plugin — use
crate::Plugin::format_parameter for human-readable values).
max: f64Maximum value in normalized space (always 1.0 for VST3 parameters).
default: f64Default value
unit: StringParameter unit (e.g., “Hz”, “dB”, “%”)
step_count: i32Step count, straight from VST3 ParameterInfo::stepCount, which counts the gaps between
discrete values rather than the values themselves: 0 is continuous, 1 is a two-state
toggle, and n is a list of n + 1 values. So a three-way selector reports 2, not 3.
can_automate: boolWhether the parameter can be automated
is_read_only: boolWhether the parameter is read-only
is_bypass: boolWhether the parameter is a bypass control
flags: u32Parameter flags
Implementations§
Source§impl Parameter
impl Parameter
Sourcepub fn normalized_to_plain(&self, normalized: f64) -> f64
pub fn normalized_to_plain(&self, normalized: f64) -> f64
Convert normalized value (0.0-1.0) to plain value
Sourcepub fn step_index(&self, normalized: f64) -> Option<i32>
pub fn step_index(&self, normalized: f64) -> Option<i32>
Which discrete value a normalized position selects, for a stepped parameter: 0..=step_count
(so step_count + 1 possible values). None for a continuous parameter.
Sourcepub fn plain_to_normalized(&self, plain: f64) -> f64
pub fn plain_to_normalized(&self, plain: f64) -> f64
Convert plain value to normalized value (0.0-1.0)
Sourcepub fn format_value(&self, normalized: f64) -> String
pub fn format_value(&self, normalized: f64) -> String
Approximate a human-readable value string from normalized space.
This cannot know the plugin’s internal mapping (VST3 keeps that private), so
for continuous parameters it just reports the normalized number with the unit.
For accurate display (e.g. "440.00 Hz"), use
crate::Plugin::format_parameter, which asks the plugin to format it.
Sourcepub fn is_discrete(&self) -> bool
pub fn is_discrete(&self) -> bool
Whether this parameter takes discrete steps rather than a continuous range.
True for toggles too — a toggle is just the one-step case. See Self::step_count for the
VST3 counting convention.
Sourcepub fn is_boolean(&self) -> bool
pub fn is_boolean(&self) -> bool
Whether this parameter is a two-state toggle (VST3 stepCount == 1).