From eb11da731d5bcdee0b4a4d16c8cd16907f32386e Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Wed, 21 Sep 2022 16:11:17 +0200 Subject: [PATCH] Enable the standalone for gain_gui_egui --- plugins/examples/gain_gui_egui/Cargo.toml | 5 +++-- plugins/examples/gain_gui_egui/src/lib.rs | 4 ++-- plugins/examples/gain_gui_egui/src/main.rs | 7 +++++++ 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 plugins/examples/gain_gui_egui/src/main.rs diff --git a/plugins/examples/gain_gui_egui/Cargo.toml b/plugins/examples/gain_gui_egui/Cargo.toml index 85b226e6..1fe8a927 100644 --- a/plugins/examples/gain_gui_egui/Cargo.toml +++ b/plugins/examples/gain_gui_egui/Cargo.toml @@ -8,10 +8,11 @@ license = "ISC" description = "A simple gain plugin with an egui GUI" [lib] -crate-type = ["cdylib"] +# The `lib` artifact is needed for the standalone target +crate-type = ["cdylib", "lib"] [dependencies] -nih_plug = { path = "../../../", features = ["assert_process_allocs"] } +nih_plug = { path = "../../../", features = ["standalone"] } nih_plug_egui = { path = "../../../nih_plug_egui" } atomic_float = "0.1" diff --git a/plugins/examples/gain_gui_egui/src/lib.rs b/plugins/examples/gain_gui_egui/src/lib.rs index 474f338b..5197b0b2 100644 --- a/plugins/examples/gain_gui_egui/src/lib.rs +++ b/plugins/examples/gain_gui_egui/src/lib.rs @@ -7,7 +7,7 @@ use std::sync::Arc; const PEAK_METER_DECAY_MS: f64 = 150.0; /// This is mostly identical to the gain example, minus some fluff, and with a GUI. -struct Gain { +pub struct Gain { params: Arc, /// Needed to normalize the peak meter's response based on the sample rate. @@ -21,7 +21,7 @@ struct Gain { } #[derive(Params)] -struct GainParams { +pub struct GainParams { /// The editor state, saved together with the parameter state so the custom scaling can be /// restored. #[persist = "editor-state"] diff --git a/plugins/examples/gain_gui_egui/src/main.rs b/plugins/examples/gain_gui_egui/src/main.rs new file mode 100644 index 00000000..85a26466 --- /dev/null +++ b/plugins/examples/gain_gui_egui/src/main.rs @@ -0,0 +1,7 @@ +use nih_plug::prelude::*; + +use gain_gui_egui::Gain; + +fn main() { + nih_export_standalone::(); +}