Add a dedicated bypass param for Diopser
This will be shown in the GUI.
This commit is contained in:
parent
3f0922b5c0
commit
aee08bae20
|
@ -81,6 +81,12 @@ struct DiopserParams {
|
|||
#[persist = "editor-state"]
|
||||
editor_state: Arc<ViziaState>,
|
||||
|
||||
/// This plugin really doesn't need its own bypass parameter, but it's still useful to have a
|
||||
/// dedicated one so it can be shown in the GUI. This is linked to the host's bypass if the host
|
||||
/// supports it.
|
||||
#[id = "bypass"]
|
||||
bypass: BoolParam,
|
||||
|
||||
/// The number of all-pass filters applied in series.
|
||||
#[id = "stages"]
|
||||
filter_stages: IntParam,
|
||||
|
@ -144,6 +150,8 @@ impl DiopserParams {
|
|||
Self {
|
||||
editor_state: editor::default_state(),
|
||||
|
||||
bypass: BoolParam::new("Bypass", false).make_bypass(),
|
||||
|
||||
filter_stages: IntParam::new(
|
||||
"Filter Stages",
|
||||
0,
|
||||
|
@ -295,11 +303,12 @@ impl Plugin for Diopser {
|
|||
let smoothing_interval =
|
||||
unnormalize_automation_precision(self.params.automation_precision.value());
|
||||
|
||||
if !self.params.bypass.value() {
|
||||
for mut channel_samples in buffer.iter_samples() {
|
||||
self.maybe_update_filters(smoothing_interval);
|
||||
|
||||
// We can compute the filters for both channels at once. The SIMD version thus now only
|
||||
// supports steroo audio.
|
||||
// We can compute the filters for both channels at once. The SIMD version thus now
|
||||
// only supports steroo audio.
|
||||
let mut samples = unsafe { channel_samples.to_simd_unchecked() };
|
||||
|
||||
for filter in self
|
||||
|
@ -312,6 +321,7 @@ impl Plugin for Diopser {
|
|||
|
||||
unsafe { channel_samples.from_simd_unchecked(samples) };
|
||||
}
|
||||
}
|
||||
|
||||
// Compute a spectrum for the GUI if needed
|
||||
if self.params.editor_state.is_open() {
|
||||
|
|
Loading…
Reference in a new issue