Fix modulating non-smoothed parameters
And also get rid of duplicate code here.
This commit is contained in:
parent
0459405ced
commit
9601c9c0c1
1 changed files with 6 additions and 12 deletions
|
@ -666,12 +666,9 @@ impl<P: ClapPlugin> Wrapper<P> {
|
||||||
/ unsafe { param_ptr.step_count() }.unwrap_or(1) as f32;
|
/ unsafe { param_ptr.step_count() }.unwrap_or(1) as f32;
|
||||||
|
|
||||||
// Also update the parameter's smoothing if applicable
|
// Also update the parameter's smoothing if applicable
|
||||||
match sample_rate {
|
unsafe { param_ptr.set_normalized_value(normalized_value) };
|
||||||
Some(sample_rate) => unsafe {
|
if let Some(sample_rate) = sample_rate {
|
||||||
param_ptr.set_normalized_value(normalized_value);
|
unsafe { param_ptr.update_smoother(sample_rate, false) };
|
||||||
param_ptr.update_smoother(sample_rate, false);
|
|
||||||
},
|
|
||||||
None => unsafe { param_ptr.set_normalized_value(normalized_value) },
|
|
||||||
}
|
}
|
||||||
|
|
||||||
true
|
true
|
||||||
|
@ -681,12 +678,9 @@ impl<P: ClapPlugin> Wrapper<P> {
|
||||||
/ unsafe { param_ptr.step_count() }.unwrap_or(1) as f32;
|
/ unsafe { param_ptr.step_count() }.unwrap_or(1) as f32;
|
||||||
|
|
||||||
// Also update the parameter's smoothing if applicable
|
// Also update the parameter's smoothing if applicable
|
||||||
match sample_rate {
|
unsafe { param_ptr.modulate_value(normalized_delta) };
|
||||||
Some(sample_rate) => unsafe {
|
if let Some(sample_rate) = sample_rate {
|
||||||
param_ptr.modulate_value(normalized_delta);
|
unsafe { param_ptr.update_smoother(sample_rate, false) };
|
||||||
param_ptr.update_smoother(sample_rate, false);
|
|
||||||
},
|
|
||||||
None => unsafe { param_ptr.set_normalized_value(normalized_delta) },
|
|
||||||
}
|
}
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|
Loading…
Add table
Reference in a new issue