pub trait InternalParamMut: Param {
// Required methods
unsafe fn _internal_set_plain_value(&self, plain: Self::Plain) -> bool;
unsafe fn _internal_set_normalized_value(&self, normalized: f32) -> bool;
unsafe fn _internal_modulate_value(&self, modulation_offset: f32) -> bool;
unsafe fn _internal_update_smoother(&self, sample_rate: f32, reset: bool);
}Expand description
Contains the setters for parameters. Only to be used by nice-plug’s internal libraries. These are exposed as unsafe methods to avoid confusion.
Required Methods§
Sourceunsafe fn _internal_set_plain_value(&self, plain: Self::Plain) -> bool
unsafe fn _internal_set_plain_value(&self, plain: Self::Plain) -> bool
Set this parameter based on a plain, unnormalized value. This does not snap to step sizes
for continuous parameters (i.e. FloatParam). If
modulate_value() has previously been called with a non
zero value then this offset is taken into account to form the effective value.
Returns whether or not the value has changed. Any parameter callbacks are only run the value has actually changed.
This does not update the smoother.
§Safety
This is only allowed to be used by nice-plug’s internal libraries.
Sourceunsafe fn _internal_set_normalized_value(&self, normalized: f32) -> bool
unsafe fn _internal_set_normalized_value(&self, normalized: f32) -> bool
Set this parameter based on a normalized value. The normalized value will be snapped to the
step size for continuous parameters (i.e. FloatParam). If
modulate_value() has previously been called with a non
zero value then this offset is taken into account to form the effective value.
Returns whether or not the value has changed. Any parameter callbacks are only run the value has actually changed.
This does not update the smoother.
§Safety
This is only allowed to be used by nice-plug’s internal libraries.
Sourceunsafe fn _internal_modulate_value(&self, modulation_offset: f32) -> bool
unsafe fn _internal_modulate_value(&self, modulation_offset: f32) -> bool
Add a modulation offset to the value’s unmodulated value. This value sticks until this
function is called again with a 0.0 value. Out of bound values will be clamped to the
parameter’s range. The normalized value will be snapped to the step size for continuous
parameters (i.e. FloatParam).
Returns whether or not the value has changed. Any parameter callbacks are only run the value has actually changed.
This does not update the smoother.
§Safety
This is only allowed to be used by nice-plug’s internal libraries.
Sourceunsafe fn _internal_update_smoother(&self, sample_rate: f32, reset: bool)
unsafe fn _internal_update_smoother(&self, sample_rate: f32, reset: bool)
Update the smoother state to point to the current value. Also used when initializing and restoring a plugin so everything is in sync. In that case the smoother should completely reset to the current value.
§Safety
This is only allowed to be used by nice-plug’s internal libraries.