Struct nih_plug::params::enums::EnumParamInner
source · pub struct EnumParamInner { /* private fields */ }
Expand description
Implementations§
source§impl EnumParamInner
impl EnumParamInner
sourcepub fn unmodulated_plain_id(&self) -> Option<&'static str>
pub fn unmodulated_plain_id(&self) -> Option<&'static str>
Get the stable ID for the parameter’s current value according to
unmodulated_plain_value()
. Returns None
if this enum
parameter doesn’t have any stable IDs.
sourcepub fn set_from_id(&self, id: &str) -> bool
pub fn set_from_id(&self, id: &str) -> bool
Set the parameter based on a serialized stable string identifier. Return whether the ID was known and the parameter was set.
Trait Implementations§
source§impl Debug for EnumParamInner
impl Debug for EnumParamInner
source§impl Display for EnumParamInner
impl Display for EnumParamInner
source§impl Param for EnumParamInner
impl Param for EnumParamInner
source§fn poly_modulation_id(&self) -> Option<u32>
fn poly_modulation_id(&self) -> Option<u32>
Get this parameter’s polyphonic modulation ID. If this is set for a parameter in a CLAP
plugin, then polyphonic modulation will be enabled for that parameter. Polyphonic modulation
is communicated to the plugin through
NoteEvent::PolyModulation
and
NoteEvent::MonoAutomation
events. See the
documentation on those events for more information. Read moresource§fn modulated_plain_value(&self) -> Self::Plain
fn modulated_plain_value(&self) -> Self::Plain
Get the unnormalized value for this parameter.
source§fn modulated_normalized_value(&self) -> f32
fn modulated_normalized_value(&self) -> f32
Get the normalized
[0, 1]
value for this parameter.source§fn default_plain_value(&self) -> Self::Plain
fn default_plain_value(&self) -> Self::Plain
Get the unnormalized default value for this parameter.
source§fn unmodulated_plain_value(&self) -> Self::Plain
fn unmodulated_plain_value(&self) -> Self::Plain
Get the unnormalized value for this parameter before any (monophonic) modulation coming from
the host has been applied. If the host is not currently modulating this parameter than this
will be the same as
modulated_plain_value()
. This may be
useful for displaying modulation differently in plugin GUIs. Right now only CLAP plugins in
Bitwig Studio use modulation.source§fn unmodulated_normalized_value(&self) -> f32
fn unmodulated_normalized_value(&self) -> f32
Get the normalized
[0, 1]
value for this parameter before any (monophonic) modulation
coming from the host has been applied. If the host is not currently modulating this
parameter than this will be the same as
modulated_normalized_value()
. This may be useful for
displaying modulation differently in plugin GUIs. Right now only CLAP plugins in Bitwig
Studio use modulation.source§fn step_count(&self) -> Option<usize>
fn step_count(&self) -> Option<usize>
Get the number of steps for this parameter, if it is discrete. Used for the host’s generic
UI.
source§fn previous_step(&self, from: Self::Plain, finer: bool) -> Self::Plain
fn previous_step(&self, from: Self::Plain, finer: bool) -> Self::Plain
Returns the previous step from a specific value for this parameter. This can be the same as
from
if the value is at the start of its range. This is mainly used for scroll wheel
interaction in plugin GUIs. When the parameter is not discrete then a step should cover one
hundredth of the normalized range instead. Read moresource§fn next_step(&self, from: Self::Plain, finer: bool) -> Self::Plain
fn next_step(&self, from: Self::Plain, finer: bool) -> Self::Plain
Returns the next step from a specific value for this parameter. This can be the same as
from
if the value is at the end of its range. This is mainly used for scroll wheel
interaction in plugin GUIs. When the parameter is not discrete then a step should cover one
hundredth of the normalized range instead. Read moresource§fn normalized_value_to_string(
&self,
normalized: f32,
_include_unit: bool
) -> String
fn normalized_value_to_string( &self, normalized: f32, _include_unit: bool ) -> String
Get the string representation for a normalized value. Used as part of the wrappers. Most
plugin formats already have support for units, in which case it shouldn’t be part of this
string or some DAWs may show duplicate units.
source§fn string_to_normalized_value(&self, string: &str) -> Option<f32>
fn string_to_normalized_value(&self, string: &str) -> Option<f32>
Get the string representation for a normalized value. Used as part of the wrappers.
source§fn preview_normalized(&self, plain: Self::Plain) -> f32
fn preview_normalized(&self, plain: Self::Plain) -> f32
Get the normalized value for a plain, unnormalized value, as a float. Used as part of the
wrappers.
source§fn preview_plain(&self, normalized: f32) -> Self::Plain
fn preview_plain(&self, normalized: f32) -> Self::Plain
Get the plain, unnormalized value for a normalized value, as a float. Used as part of the
wrappers. This does snap to step sizes for continuous parameters (i.e.
FloatParam
).source§fn flags(&self) -> ParamFlags
fn flags(&self) -> ParamFlags
Flags to control the parameter’s behavior. See
ParamFlags
.source§fn as_ptr(&self) -> ParamPtr
fn as_ptr(&self) -> ParamPtr
Internal implementation detail for implementing
Params
. This should
not be used directly.source§fn default_normalized_value(&self) -> f32
fn default_normalized_value(&self) -> f32
Get the normalized
[0, 1]
default value for this parameter.source§fn previous_normalized_step(&self, from: f32, finer: bool) -> f32
fn previous_normalized_step(&self, from: f32, finer: bool) -> f32
The same as
previous_step()
, but for normalized values. This is
mostly useful for GUI widgets.source§fn next_normalized_step(&self, from: f32, finer: bool) -> f32
fn next_normalized_step(&self, from: f32, finer: bool) -> f32
The same as
next_step()
, but for normalized values. This is mostly
useful for GUI widgets.source§fn preview_modulated(&self, normalized_offset: f32) -> Self::Plain
fn preview_modulated(&self, normalized_offset: f32) -> Self::Plain
Get the plain, unnormalized value for this parameter after polyphonic modulation has been
applied. This is a convenience method for calling
preview_plain()
with unmodulated_normalized_value() + normalized_offset
.`Auto Trait Implementations§
impl !RefUnwindSafe for EnumParamInner
impl Send for EnumParamInner
impl Sync for EnumParamInner
impl Unpin for EnumParamInner
impl !UnwindSafe for EnumParamInner
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