Skip to main content

ParameterInfo

Struct ParameterInfo 

Source
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: ParameterId

Unique parameter identifier.

§name: &'static str

Full parameter name (e.g., “Master Volume”).

§short_name: &'static str

Short parameter name for constrained UIs (e.g., “Vol”).

§units: &'static str

Unit label (e.g., “dB”, “%”, “Hz”).

§unit: ParameterUnit

Unit 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: ParameterValue

Default value in normalized form (0.0 to 1.0).

§step_count: i32

Number of discrete steps. 0 = continuous, 1 = toggle, >1 = discrete.

§flags: ParameterFlags

Behavioral flags.

§group_id: GroupId

Parameter group ID. ROOT_GROUP_ID (0) for ungrouped parameters.

Implementations§

Source§

impl ParameterInfo

Source

pub const fn new(id: ParameterId, name: &'static str) -> Self

Create a new continuous parameter with default flags.

Source

pub const fn with_short_name(self, short_name: &'static str) -> Self

Set the short name.

Source

pub const fn with_units(self, units: &'static str) -> Self

Set the unit label.

Source

pub const fn with_default(self, default: ParameterValue) -> Self

Set the default normalized value.

Source

pub const fn with_steps(self, steps: i32) -> Self

Set the step count (0 = continuous).

Source

pub const fn with_flags(self, flags: ParameterFlags) -> Self

Set parameter flags.

Source

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 = true flag
  • 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),
        }
    }
}
Source

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.

Source

pub const fn with_group(self, group_id: GroupId) -> Self

Set the group ID (parameter group).

Trait Implementations§

Source§

impl Clone for ParameterInfo

Source§

fn clone(&self) -> ParameterInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParameterInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.