pub enum ParamPtr {
FloatParam(*const FloatParam),
IntParam(*const IntParam),
BoolParam(*const BoolParam),
EnumParam(*const EnumParamInner),
}
Expand description
Internal pointers to parameters. This is an implementation detail used by the wrappers for type erasure.
Variants§
FloatParam(*const FloatParam)
IntParam(*const IntParam)
BoolParam(*const BoolParam)
EnumParam(*const EnumParamInner)
Since we can’t encode the actual enum here, this inner parameter struct contains all of the relevant information from the enum so it can be type erased.
Implementations§
source§impl ParamPtr
impl ParamPtr
sourcepub unsafe fn poly_modulation_id(&self) -> Option<u32>
pub unsafe fn poly_modulation_id(&self) -> Option<u32>
sourcepub unsafe fn modulated_normalized_value(&self) -> f32
pub unsafe fn modulated_normalized_value(&self) -> f32
sourcepub unsafe fn unmodulated_normalized_value(&self) -> f32
pub unsafe fn unmodulated_normalized_value(&self) -> f32
sourcepub unsafe fn default_normalized_value(&self) -> f32
pub unsafe fn default_normalized_value(&self) -> f32
sourcepub unsafe fn step_count(&self) -> Option<usize>
pub unsafe fn step_count(&self) -> Option<usize>
sourcepub unsafe fn previous_normalized_step(&self, from: f32, finer: bool) -> f32
pub unsafe fn previous_normalized_step(&self, from: f32, finer: bool) -> f32
sourcepub unsafe fn next_normalized_step(&self, from: f32, finer: bool) -> f32
pub unsafe fn next_normalized_step(&self, from: f32, finer: bool) -> f32
sourcepub unsafe fn normalized_value_to_string(
&self,
normalized: f32,
include_unit: bool
) -> String
pub unsafe fn normalized_value_to_string( &self, normalized: f32, include_unit: bool ) -> String
sourcepub unsafe fn string_to_normalized_value(&self, string: &str) -> Option<f32>
pub unsafe fn string_to_normalized_value(&self, string: &str) -> Option<f32>
sourcepub unsafe fn flags(&self) -> ParamFlags
pub unsafe fn flags(&self) -> ParamFlags
sourcepub unsafe fn modulated_plain_value(&self) -> f32
pub unsafe fn modulated_plain_value(&self) -> f32
Get the parameter’s plain, unnormalized value, converted to a float. Useful in conjunction
with preview_plain()
to compare a snapped discrete value to a
parameter’s current snapped value without having to do a back and forth conversion using
normalized values.
Safety
Calling this function is only safe as long as the object this ParamPtr
was created for is
still alive.
sourcepub unsafe fn unmodulated_plain_value(&self) -> f32
pub unsafe fn unmodulated_plain_value(&self) -> f32
Get the parameter’s plain, unnormalized value, converted to a float, before any monophonic
host modulation has been applied. This is useful for handling modulated parameters for CLAP
plugins in Bitwig in a way where the actual parameter does not move in the GUI while the
parameter is being modulated. You can also use this to show the difference between the
unmodulated value and the current value. Useful in conjunction with
preview_plain()
to compare a snapped discrete value to a
parameter’s current snapped value without having to do a back and forth conversion using
normalized values.
Safety
Calling this function is only safe as long as the object this ParamPtr
was created for is
still alive.
sourcepub unsafe fn default_plain_value(&self) -> f32
pub unsafe fn default_plain_value(&self) -> f32
Get the parameter’s default value as a plain, unnormalized value, converted to a float.
Safety
Calling this function is only safe as long as the object this ParamPtr
was created for is
still alive.
sourcepub unsafe fn preview_normalized(&self, plain: f32) -> f32
pub unsafe fn preview_normalized(&self, plain: f32) -> f32
Get the normalized value for a plain, unnormalized value, as a float. Used as part of the wrappers.
Safety
Calling this function is only safe as long as the object this ParamPtr
was created for is
still alive.
sourcepub unsafe fn preview_plain(&self, normalized: f32) -> f32
pub unsafe fn preview_plain(&self, normalized: f32) -> f32
Get the plain, unnormalized value for a normalized value, as a float. Used as part of the wrappers.
Safety
Calling this function is only safe as long as the object this ParamPtr
was created for is
still alive.