diff --git a/Cargo.lock b/Cargo.lock index e476cbc8..6046a592 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,14 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "gain" +version = "0.1.0" +dependencies = [ + "nih_plug", + "nih_plug_derive", +] + [[package]] name = "nih_plug" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 63a7effc..d4fefb6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,2 +1,2 @@ [workspace] -members = ["nih_plug", "nih_plug_derive"] +members = ["nih_plug", "nih_plug_derive", "plugins/gain"] diff --git a/plugins/gain/Cargo.toml b/plugins/gain/Cargo.toml new file mode 100644 index 00000000..1146863a --- /dev/null +++ b/plugins/gain/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "gain" +version = "0.1.0" +edition = "2021" + +[lib] +crate-type = ["cdylib"] + +[dependencies] + +[dependencies.nih_plug] +path = "../../nih_plug" + +[dependencies.nih_plug_derive] +path = "../../nih_plug_derive" diff --git a/plugins/gain/src/lib.rs b/plugins/gain/src/lib.rs new file mode 100644 index 00000000..3c0b7327 --- /dev/null +++ b/plugins/gain/src/lib.rs @@ -0,0 +1,33 @@ +use nih_plug::params::{FloatParam, IntParam, Params, Range}; +use nih_plug_derive::Params; + +#[derive(Params)] +struct FooParams { + #[id("pain")] + pub pain: FloatParam, + #[id("pain_stages")] + pub pain_stages: IntParam, + + #[id("identifiers_are_stable")] + pub but_field_names_can_change: FloatParam, +} + +impl Default for FooParams { + fn default() -> Self { + Self { + pain: FloatParam { + value: 69.0, + range: Range::Linear { + min: -420.0, + max: 420.0, + }, + name: "Pain", + unit: " Hertz", + value_to_string: None, + string_to_value: None, + }, + pain_stages: todo!(), + but_field_names_can_change: todo!(), + } + } +}