mirror of
https://github.com/robbert-vdh/nih-plug.git
synced 2026-07-01 02:36:54 +00:00
Auto-disable Diopser safe mode for older instances
Since this used to not do anything.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "diopser"
|
||||
version = "0.3.0"
|
||||
version = "0.4.0"
|
||||
edition = "2021"
|
||||
authors = ["Robbert van der Helm <mail@robbertvanderhelm.nl>"]
|
||||
license = "GPL-3.0-or-later"
|
||||
@@ -20,6 +20,7 @@ nih_plug = { path = "../../", features = ["assert_process_allocs"] }
|
||||
nih_plug_vizia = { path = "../../nih_plug_vizia" }
|
||||
|
||||
atomic_float = "0.1"
|
||||
semver = "1.0.14"
|
||||
|
||||
# For the GUI
|
||||
realfft = "3.0"
|
||||
|
||||
@@ -137,6 +137,19 @@ impl Plugin for Diopser {
|
||||
)
|
||||
}
|
||||
|
||||
fn filter_state(state: &mut PluginState) {
|
||||
// Safe-mode is enabled by default, so to avoid changing the behavior we'll keep it disabled
|
||||
// for older presets
|
||||
if semver::Version::parse(&state.version)
|
||||
.map(|version| version < semver::Version::parse("0.4.0").unwrap())
|
||||
.unwrap_or(true)
|
||||
{
|
||||
state
|
||||
.fields
|
||||
.insert(String::from("safe-mode"), String::from("false"));
|
||||
}
|
||||
}
|
||||
|
||||
fn accepts_bus_config(&self, config: &BusConfig) -> bool {
|
||||
// The SIMD version only supports stereo
|
||||
config.num_input_channels == config.num_output_channels && config.num_input_channels == 2
|
||||
|
||||
Reference in New Issue
Block a user