1
0
Fork 0

Add a dummy library for testing the macro

This commit is contained in:
Robbert van der Helm 2022-01-25 22:18:55 +01:00
parent 7065e900a7
commit 52f80de5dc
4 changed files with 57 additions and 1 deletions

8
Cargo.lock generated
View file

@ -2,6 +2,14 @@
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 3
[[package]]
name = "gain"
version = "0.1.0"
dependencies = [
"nih_plug",
"nih_plug_derive",
]
[[package]] [[package]]
name = "nih_plug" name = "nih_plug"
version = "0.1.0" version = "0.1.0"

View file

@ -1,2 +1,2 @@
[workspace] [workspace]
members = ["nih_plug", "nih_plug_derive"] members = ["nih_plug", "nih_plug_derive", "plugins/gain"]

15
plugins/gain/Cargo.toml Normal file
View file

@ -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"

33
plugins/gain/src/lib.rs Normal file
View file

@ -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!(),
}
}
}