From 6e03f8141baa935bc4a68f3f0f56072c34148c9c Mon Sep 17 00:00:00 2001 From: PikminGuts92 Date: Tue, 26 Mar 2024 22:25:51 -0400 Subject: [PATCH] Move midi functionality to separate crate --- core/grim/Cargo.toml | 4 ++-- core/grim/src/lib.rs | 4 +++- core/grim_midi/Cargo.toml | 14 ++++++++++++++ core/{grim/src/midi => grim_midi/src}/io.rs | 0 .../{grim/src/midi/mod.rs => grim_midi/src/lib.rs} | 0 core/{grim/src/midi => grim_midi/src}/reader.rs | 0 6 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 core/grim_midi/Cargo.toml rename core/{grim/src/midi => grim_midi/src}/io.rs (100%) rename core/{grim/src/midi/mod.rs => grim_midi/src/lib.rs} (100%) rename core/{grim/src/midi => grim_midi/src}/reader.rs (100%) diff --git a/core/grim/Cargo.toml b/core/grim/Cargo.toml index 459f4b4..915ebaa 100644 --- a/core/grim/Cargo.toml +++ b/core/grim/Cargo.toml @@ -13,13 +13,13 @@ gltf = { workspace = true, optional = true } gltf-json = { workspace = true, optional = true } grim_gltf = { path = "../grim_gltf", optional = true } grim_macros = { path = "../grim_macros" } +grim_midi = {path = "../grim_midi", optional = true } grim_traits = { path = "../grim_traits" } half = { version = "2.3.1", default-features = false } image = { version = "0.24.8", default-features = false, features = [ "dxt", "png" ] } itertools = { workspace = true } lazy_static = { workspace = true } log = { workspace = true } -midly = { version = "0.5.3", optional = true } nalgebra = { version = "0.32.3", optional = true } nom = "7.1.3" # pyo3 = { version = "0.17.3", optional = true, features = [ "extension-module" ] } @@ -37,7 +37,7 @@ rstest = "0.18.2" [features] audio = [ "bitstream-io", "fon", "wav" ] audio_experimental = [] -midi = [ "midly" ] +midi = [ "grim_midi" ] model = [ "gltf", "gltf-json", "grim_gltf", "nalgebra", "serde" ] python = [ "pyo3" ] diff --git a/core/grim/src/lib.rs b/core/grim/src/lib.rs index 1ce8d63..eb2c6ab 100644 --- a/core/grim/src/lib.rs +++ b/core/grim/src/lib.rs @@ -2,7 +2,9 @@ pub mod ark; #[cfg(feature = "audio")] pub mod audio; pub mod dta; pub mod io; -#[cfg(feature = "midi")] pub mod midi; +#[cfg(feature = "midi")] pub mod midi { + pub use grim_midi::*; +} #[cfg(feature = "model")] pub mod model; pub mod scene; mod system; diff --git a/core/grim_midi/Cargo.toml b/core/grim_midi/Cargo.toml new file mode 100644 index 0000000..143ebaa --- /dev/null +++ b/core/grim_midi/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "grim_midi" +version.workspace = true +authors.workspace = true +edition.workspace = true + +[dependencies] +midly = { version = "0.5.3" } + +[dev-dependencies] +rstest = "0.18.2" + +[lints] +workspace = true \ No newline at end of file diff --git a/core/grim/src/midi/io.rs b/core/grim_midi/src/io.rs similarity index 100% rename from core/grim/src/midi/io.rs rename to core/grim_midi/src/io.rs diff --git a/core/grim/src/midi/mod.rs b/core/grim_midi/src/lib.rs similarity index 100% rename from core/grim/src/midi/mod.rs rename to core/grim_midi/src/lib.rs diff --git a/core/grim/src/midi/reader.rs b/core/grim_midi/src/reader.rs similarity index 100% rename from core/grim/src/midi/reader.rs rename to core/grim_midi/src/reader.rs