From ac98cbe6c73cc0698fa175ab5ecec70c98bf0179 Mon Sep 17 00:00:00 2001 From: Haze Weathers Date: Tue, 16 Sep 2025 14:15:12 -0600 Subject: [PATCH] multi-plugin structure --- Cargo.lock | 28 ++++++++++++++++++---------- Cargo.toml | 21 ++++++--------------- plugins/dfpworm/.gitignore | 1 + plugins/dfpworm/Cargo.toml | 12 ++++++++++++ plugins/dfpworm/src/lib.rs | 14 ++++++++++++++ plugins/gain/.gitignore | 1 + plugins/gain/Cargo.toml | 12 ++++++++++++ {src => plugins/gain/src}/editor.rs | 0 {src => plugins/gain/src}/lib.rs | 0 9 files changed, 64 insertions(+), 25 deletions(-) create mode 100644 plugins/dfpworm/.gitignore create mode 100644 plugins/dfpworm/Cargo.toml create mode 100644 plugins/dfpworm/src/lib.rs create mode 100644 plugins/gain/.gitignore create mode 100644 plugins/gain/Cargo.toml rename {src => plugins/gain/src}/editor.rs (100%) rename {src => plugins/gain/src}/lib.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 4ab9fea..5bd0a92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -903,6 +903,15 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "dfpworm" +version = "0.1.0" +dependencies = [ + "atomic_float 1.1.0", + "nih_plug", + "nih_plug_vizia", +] + [[package]] name = "digest" version = "0.10.7" @@ -1235,6 +1244,15 @@ dependencies = [ "byteorder", ] +[[package]] +name = "gain" +version = "0.1.0" +dependencies = [ + "atomic_float 1.1.0", + "nih_plug", + "nih_plug_vizia", +] + [[package]] name = "generational-arena" version = "0.2.9" @@ -1588,16 +1606,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -[[package]] -name = "learner_plug" -version = "0.1.0" -dependencies = [ - "atomic_float 1.1.0", - "nih_plug", - "nih_plug_vizia", - "parking_lot", -] - [[package]] name = "libc" version = "0.2.175" diff --git a/Cargo.toml b/Cargo.toml index 2757761..0f91226 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,16 +1,7 @@ -[package] -name = "learner_plug" -version = "0.1.0" -edition = "2024" - -[lib] -crate-type = ["cdylib", "lib"] - -[dependencies] -atomic_float = "1.1.0" -nih_plug = { git = "https://github.com/robbert-vdh/nih-plug.git", version = "0.0.0", features = ["assert_process_allocs"] } -nih_plug_vizia = { git = "https://github.com/robbert-vdh/nih-plug.git", version = "0.0.0" } -parking_lot = "0.12.4" - [workspace] -members = ["xtask"] +resolver = "3" +members = [ + "xtask", + "plugins/dfpworm", + "plugins/gain", +] diff --git a/plugins/dfpworm/.gitignore b/plugins/dfpworm/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/plugins/dfpworm/.gitignore @@ -0,0 +1 @@ +/target diff --git a/plugins/dfpworm/Cargo.toml b/plugins/dfpworm/Cargo.toml new file mode 100644 index 0000000..1a0860d --- /dev/null +++ b/plugins/dfpworm/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "dfpworm" +version = "0.1.0" +edition = "2024" + +[lib] +crate-type = ["cdylib"] + +[dependencies] +atomic_float = "1.1" +nih_plug = { git = "https://github.com/robbert-vdh/nih-plug.git", version = "0.0.0", features = ["assert_process_allocs"] } +nih_plug_vizia = { git = "https://github.com/robbert-vdh/nih-plug.git", version = "0.0.0" } diff --git a/plugins/dfpworm/src/lib.rs b/plugins/dfpworm/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/plugins/dfpworm/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/plugins/gain/.gitignore b/plugins/gain/.gitignore new file mode 100644 index 0000000..ea8c4bf --- /dev/null +++ b/plugins/gain/.gitignore @@ -0,0 +1 @@ +/target diff --git a/plugins/gain/Cargo.toml b/plugins/gain/Cargo.toml new file mode 100644 index 0000000..d64823a --- /dev/null +++ b/plugins/gain/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "gain" +version = "0.1.0" +edition = "2024" + +[lib] +crate-type = ["cdylib"] + +[dependencies] +atomic_float = "1.1" +nih_plug = { git = "https://github.com/robbert-vdh/nih-plug.git", version = "0.0.0", features = ["assert_process_allocs"] } +nih_plug_vizia = { git = "https://github.com/robbert-vdh/nih-plug.git", version = "0.0.0" } diff --git a/src/editor.rs b/plugins/gain/src/editor.rs similarity index 100% rename from src/editor.rs rename to plugins/gain/src/editor.rs diff --git a/src/lib.rs b/plugins/gain/src/lib.rs similarity index 100% rename from src/lib.rs rename to plugins/gain/src/lib.rs