ParamInfo

Struct ParamInfo 

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

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”).

§default_normalized: ParamValue

Default value in normalized form (0.0 to 1.0).

§step_count: i32

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

§flags: ParamFlags

Behavioral flags.

§unit_id: UnitId

VST3 Unit ID (parameter group). ROOT_UNIT_ID (0) for ungrouped parameters.

Implementations§

Source§

impl ParamInfo

Source

pub const fn new(id: ParamId, 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: ParamValue) -> 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: ParamFlags) -> Self

Set parameter flags.

Source

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

pub const fn with_unit(self, unit_id: UnitId) -> Self

Set the unit ID (parameter group).

Trait Implementations§

Source§

impl Clone for ParamInfo

Source§

fn clone(&self) -> ParamInfo

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 ParamInfo

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.