pub struct ParameterDescriptor {
pub id: u32,
pub stable_id: String,
pub name: String,
pub kind: ParameterKind,
pub min: f64,
pub max: f64,
pub default: f64,
pub automatable: bool,
}Expand description
A single automatable plugin parameter and its value range.
Fields§
§id: u32The parameter’s numeric id, unique within a plugin.
stable_id: StringThe backend-stable identifier string.
name: StringThe human-readable display name.
kind: ParameterKindThe value domain (ParameterKind).
min: f64The inclusive minimum plain value.
max: f64The inclusive maximum plain value.
default: f64The default plain value, clamped into min..=max.
automatable: boolWhether a host may automate this parameter.
Implementations§
Source§impl ParameterDescriptor
impl ParameterDescriptor
Sourcepub fn new(
id: u32,
stable_id: impl Into<String>,
name: impl Into<String>,
min: f64,
max: f64,
default: f64,
) -> Result<Self>
pub fn new( id: u32, stable_id: impl Into<String>, name: impl Into<String>, min: f64, max: f64, default: f64, ) -> Result<Self>
Builds a ParameterKind::Float, automatable parameter.
default is clamped into min..=max.
§Errors
Returns an error when stable_id or name is empty after trimming, or
when min exceeds max.
Sourcepub fn with_kind(self, kind: ParameterKind) -> Self
pub fn with_kind(self, kind: ParameterKind) -> Self
Returns the descriptor with its ParameterKind replaced.
Sourcepub fn plain_to_normalized(&self, value: f64) -> f64
pub fn plain_to_normalized(&self, value: f64) -> f64
Maps a plain value to the normalized 0.0..=1.0 range.
The input is clamped into min..=max first; a zero-width range maps to
0.0.
Sourcepub fn normalized_to_plain(&self, normalized: f64) -> f64
pub fn normalized_to_plain(&self, normalized: f64) -> f64
Maps a normalized 0.0..=1.0 value back to a plain value in
min..=max.
The input is clamped into 0.0..=1.0 first.
Trait Implementations§
Source§impl Clone for ParameterDescriptor
impl Clone for ParameterDescriptor
Source§fn clone(&self) -> ParameterDescriptor
fn clone(&self) -> ParameterDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParameterDescriptor
impl Debug for ParameterDescriptor
Source§impl PartialEq for ParameterDescriptor
impl PartialEq for ParameterDescriptor
Source§fn eq(&self, other: &ParameterDescriptor) -> bool
fn eq(&self, other: &ParameterDescriptor) -> bool
self and other values to be equal, and is used by ==.