pub struct ParameterInfo {
pub id: ParameterId,
pub name: &'static str,
pub short_name: &'static str,
pub units: &'static str,
pub unit: ParameterUnit,
pub default_normalized: ParameterValue,
pub step_count: i32,
pub flags: ParameterFlags,
pub group_id: GroupId,
}Expand description
Metadata describing a single parameter.
Fields§
§id: ParameterIdUnique parameter identifier.
name: &'static strFull parameter name (e.g., “Master Volume”).
short_name: &'static strShort parameter name for constrained UIs (e.g., “Vol”).
units: &'static strUnit label (e.g., “dB”, “%”, “Hz”).
unit: ParameterUnitUnit type hint for AU hosts.
This tells AU hosts what visual control to render (checkbox, dropdown, etc.). Most parameter constructors set this automatically based on the parameter type.
default_normalized: ParameterValueDefault value in normalized form (0.0 to 1.0).
step_count: i32Number of discrete steps. 0 = continuous, 1 = toggle, >1 = discrete.
flags: ParameterFlagsBehavioral flags.
group_id: GroupIdParameter group ID. ROOT_GROUP_ID (0) for ungrouped parameters.
Implementations§
Source§impl ParameterInfo
impl ParameterInfo
Sourcepub const fn new(id: ParameterId, name: &'static str) -> Self
pub const fn new(id: ParameterId, name: &'static str) -> Self
Create a new continuous parameter with default flags.
Sourcepub const fn with_short_name(self, short_name: &'static str) -> Self
pub const fn with_short_name(self, short_name: &'static str) -> Self
Set the short name.
Sourcepub const fn with_units(self, units: &'static str) -> Self
pub const fn with_units(self, units: &'static str) -> Self
Set the unit label.
Sourcepub const fn with_default(self, default: ParameterValue) -> Self
pub const fn with_default(self, default: ParameterValue) -> Self
Set the default normalized value.
Sourcepub const fn with_steps(self, steps: i32) -> Self
pub const fn with_steps(self, steps: i32) -> Self
Set the step count (0 = continuous).
Sourcepub const fn with_flags(self, flags: ParameterFlags) -> Self
pub const fn with_flags(self, flags: ParameterFlags) -> Self
Set parameter flags.
Sourcepub const fn bypass(id: ParameterId) -> Self
pub const fn bypass(id: ParameterId) -> Self
Create a bypass toggle parameter with standard configuration.
This creates a parameter pre-configured as a bypass switch:
- Toggle (step_count = 1)
- Automatable
- Marked with
is_bypass = trueflag - Default value = 0.0 (not bypassed)
§Example
const PARAM_BYPASS: u32 = 0;
struct MyParameters {
bypass: AtomicU64,
bypass_info: ParameterInfo,
}
impl MyParameters {
fn new() -> Self {
Self {
bypass: AtomicU64::new(0.0f64.to_bits()),
bypass_info: ParameterInfo::bypass(PARAM_BYPASS),
}
}
}Sourcepub const fn with_unit(self, unit: ParameterUnit) -> Self
pub const fn with_unit(self, unit: ParameterUnit) -> Self
Set the unit type hint for AU hosts.
This is typically set automatically by parameter constructors, but can be overridden if needed.
Sourcepub const fn with_group(self, group_id: GroupId) -> Self
pub const fn with_group(self, group_id: GroupId) -> Self
Set the group ID (parameter group).
Trait Implementations§
Source§impl Clone for ParameterInfo
impl Clone for ParameterInfo
Source§fn clone(&self) -> ParameterInfo
fn clone(&self) -> ParameterInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more