Directly pass a style to .with_smoother()
This commit is contained in:
parent
d6b358f8ca
commit
cd0b870682
|
@ -59,7 +59,7 @@ impl Default for GainParams {
|
|||
max: 30.0,
|
||||
},
|
||||
)
|
||||
.with_smoother(Smoother::new(SmoothingStyle::Linear(50.0)))
|
||||
.with_smoother(SmoothingStyle::Linear(50.0))
|
||||
.with_unit(" dB")
|
||||
.with_value_to_string(formatters::f32_rounded(2)),
|
||||
some_int: IntParam::new(
|
||||
|
|
|
@ -66,7 +66,7 @@ impl Default for SineParams {
|
|||
max: 0.0,
|
||||
},
|
||||
)
|
||||
.with_smoother(Smoother::new(SmoothingStyle::Linear(3.0)))
|
||||
.with_smoother(SmoothingStyle::Linear(3.0))
|
||||
.with_unit(" dB")
|
||||
.with_value_to_string(formatters::f32_rounded(2)),
|
||||
frequency: FloatParam::new(
|
||||
|
@ -78,7 +78,7 @@ impl Default for SineParams {
|
|||
factor: Range::skew_factor(-2.0),
|
||||
},
|
||||
)
|
||||
.with_smoother(Smoother::new(SmoothingStyle::Linear(10.0)))
|
||||
.with_smoother(SmoothingStyle::Linear(10.0))
|
||||
.with_unit(" Hz")
|
||||
.with_value_to_string(formatters::f32_rounded(0)),
|
||||
use_midi: BoolParam::new("Use MIDI", false),
|
||||
|
|
|
@ -6,7 +6,7 @@ use std::fmt::Display;
|
|||
use std::sync::Arc;
|
||||
|
||||
use self::range::{NormalizebleRange, Range};
|
||||
use self::smoothing::Smoother;
|
||||
use self::smoothing::{Smoother, SmoothingStyle};
|
||||
|
||||
pub mod internals;
|
||||
pub mod range;
|
||||
|
@ -377,8 +377,8 @@ where
|
|||
/// is the parameter's new value. This should not do anything expensive as it may be called
|
||||
/// multiple times in rapid succession, and it can be run from both the GUI and the audio
|
||||
/// thread.
|
||||
pub fn with_smoother(mut self, smoother: Smoother<T>) -> Self {
|
||||
self.smoothed = smoother;
|
||||
pub fn with_smoother(mut self, style: SmoothingStyle) -> Self {
|
||||
self.smoothed = Smoother::new(style);
|
||||
self
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue