pub struct ParamInfo {
pub id: ParamId,
pub name: &'static str,
pub short_name: &'static str,
pub units: &'static str,
pub default_normalized: ParamValue,
pub step_count: i32,
pub flags: ParamFlags,
pub unit_id: UnitId,
}Expand description
Metadata describing a single parameter.
Fields§
§id: ParamIdUnique 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”).
default_normalized: ParamValueDefault value in normalized form (0.0 to 1.0).
step_count: i32Number of discrete steps. 0 = continuous, 1 = toggle, >1 = discrete.
flags: ParamFlagsBehavioral flags.
unit_id: UnitIdVST3 Unit ID (parameter group). ROOT_UNIT_ID (0) for ungrouped parameters.
Implementations§
Source§impl ParamInfo
impl ParamInfo
Sourcepub const fn new(id: ParamId, name: &'static str) -> Self
pub const fn new(id: ParamId, 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: ParamValue) -> Self
pub const fn with_default(self, default: ParamValue) -> 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: ParamFlags) -> Self
pub const fn with_flags(self, flags: ParamFlags) -> Self
Set parameter flags.
Sourcepub const fn bypass(id: ParamId) -> Self
pub const fn bypass(id: ParamId) -> 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 MyParams {
bypass: AtomicU64,
bypass_info: ParamInfo,
}
impl MyParams {
fn new() -> Self {
Self {
bypass: AtomicU64::new(0.0f64.to_bits()),
bypass_info: ParamInfo::bypass(PARAM_BYPASS),
}
}
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParamInfo
impl RefUnwindSafe for ParamInfo
impl Send for ParamInfo
impl Sync for ParamInfo
impl Unpin for ParamInfo
impl UnwindSafe for ParamInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more