From ecf66064944213178f4eb0cb77a349f651b4558f Mon Sep 17 00:00:00 2001 From: B0ney <40839054+B0ney@users.noreply.github.com> Date: Wed, 25 Oct 2023 23:08:51 +0100 Subject: [PATCH] make xmodits-lib a workspace dependency --- Cargo.lock | 15 ++++++++++++--- Cargo.toml | 8 +++++++- audio_engine/Cargo.toml | 5 ++--- audio_engine/src/sample/buffer.rs | 2 +- data/Cargo.toml | 5 +---- data/src/lib.rs | 3 --- src/app/simple.rs | 1 - src/ripper/extraction.rs | 2 +- src/ripper/extraction/error.rs | 2 +- src/screen/config/name_preview.rs | 2 +- src/screen/config/sample_ripping.rs | 4 ++-- src/screen/settings.rs | 2 +- src/screen/tracker_info.rs | 2 +- 13 files changed, 30 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f357496f..daf49055 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -376,9 +376,8 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" name = "audio_engine" version = "0.1.0" dependencies = [ - "cpal", - "data", - "rubato", + "rodio", + "xmodits-lib", ] [[package]] @@ -3368,6 +3367,15 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "rodio" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b1bb7b48ee48471f55da122c0044fcc7600cfcc85db88240b89cb832935e611" +dependencies = [ + "cpal", +] + [[package]] name = "rubato" version = "0.14.1" @@ -4985,6 +4993,7 @@ dependencies = [ "walkdir", "windows-sys 0.48.0", "winresource", + "xmodits-lib", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index ec448f91..fd56ad9b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ wgpu = ["iced/wgpu"] # version = "0.12.0" git = "https://github.com/iced-rs/iced.git" default-features = false -features = ["image", "tokio"] +features = ["image", "tokio", "palette"] [workspace.dependencies] tokio = { version = "1.33.0", features = ["sync", "fs", "io-util", "parking_lot"] } @@ -28,6 +28,11 @@ dirs = "5.0.0" anyhow = "1.0.0" tracing = "0.1.40" +[workspace.dependencies.xmodits-lib] +git = "https://github.com/B0ney/xmodits-lib.git" +rev = "78675a3" +features = ["serde"] + [dependencies] data = { path = "data" } audio_engine = { path = "audio_engine", optional = true } @@ -36,6 +41,7 @@ tokio.workspace = true dirs.workspace = true anyhow.workspace = true tracing.workspace = true +xmodits-lib.workspace = true tracing-subscriber = "0.3.17" open = "5.0.0" diff --git a/audio_engine/Cargo.toml b/audio_engine/Cargo.toml index ea4b9cfe..48f678de 100644 --- a/audio_engine/Cargo.toml +++ b/audio_engine/Cargo.toml @@ -6,6 +6,5 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -data = { path = "../data" } -rubato = "0.14.1" -cpal = "0.15.2" \ No newline at end of file +xmodits-lib.workspace = true +rodio = { version = "0.17.3", default-features = false } diff --git a/audio_engine/src/sample/buffer.rs b/audio_engine/src/sample/buffer.rs index 1c519f44..73842e27 100644 --- a/audio_engine/src/sample/buffer.rs +++ b/audio_engine/src/sample/buffer.rs @@ -1,4 +1,4 @@ -use data::xmodits_lib::dsp; +use xmodits_lib::dsp; #[derive(Clone)] pub struct SampleBuffer { diff --git a/data/Cargo.toml b/data/Cargo.toml index 1c33fbd2..057332cc 100644 --- a/data/Cargo.toml +++ b/data/Cargo.toml @@ -5,10 +5,6 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[dependencies.xmodits-lib] -git = "https://github.com/B0ney/xmodits-lib.git" -rev = "78675a3" -features = ["serde"] [dependencies.iced_core] git = "https://github.com/iced-rs/iced.git" @@ -18,6 +14,7 @@ tokio.workspace = true dirs.workspace = true anyhow.workspace = true tracing.workspace = true +xmodits-lib.workspace = true serde = { version = "1.0", features = ["derive"] } chrono = { version = "0.4", features = ["serde"] } diff --git a/data/src/lib.rs b/data/src/lib.rs index 05b2dbba..05c659e3 100644 --- a/data/src/lib.rs +++ b/data/src/lib.rs @@ -25,6 +25,3 @@ pub const SUPPORTED_FORMATS: &[AudioFormat] = &[ AudioFormat::IFF, AudioFormat::RAW, ]; - -/// Reimport the xmodits core library. -pub use xmodits_lib; diff --git a/src/app/simple.rs b/src/app/simple.rs index 923e7438..955e72a6 100644 --- a/src/app/simple.rs +++ b/src/app/simple.rs @@ -1,5 +1,4 @@ use data::config::Config; -use data::xmodits_lib; use crate::dialog; use crate::logger::write_error_log; diff --git a/src/ripper/extraction.rs b/src/ripper/extraction.rs index 35504a39..0a7ca3d4 100644 --- a/src/ripper/extraction.rs +++ b/src/ripper/extraction.rs @@ -12,7 +12,7 @@ use super::Signal; use crate::logger::GLOBAL_TRACKER; use data::config::SampleRippingConfig; -use data::xmodits_lib::{extract, Ripper}; +use xmodits_lib::{extract, Ripper}; use std::fs::File; use std::io::{BufRead, BufReader, Seek, Write}; diff --git a/src/ripper/extraction/error.rs b/src/ripper/extraction/error.rs index 1a423b53..97d5023e 100644 --- a/src/ripper/extraction/error.rs +++ b/src/ripper/extraction/error.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use data::xmodits_lib::Error; +use xmodits_lib::Error; use crate::utils::filename; diff --git a/src/screen/config/name_preview.rs b/src/screen/config/name_preview.rs index 25a333bf..8441c32b 100644 --- a/src/screen/config/name_preview.rs +++ b/src/screen/config/name_preview.rs @@ -3,7 +3,7 @@ use std::path::PathBuf; use data::config::{SampleNameConfig, SampleNameParams, SampleRippingConfig}; -use data::xmodits_lib::interface::{name::Context, Sample}; +use xmodits_lib::interface::{name::Context, Sample}; use crate::widget::Element; diff --git a/src/screen/config/sample_ripping.rs b/src/screen/config/sample_ripping.rs index 25d89b23..4bb46f13 100644 --- a/src/screen/config/sample_ripping.rs +++ b/src/screen/config/sample_ripping.rs @@ -3,7 +3,7 @@ use std::path::{Path, PathBuf}; use data::config::SampleRippingConfig; -use data::xmodits_lib::exporter::AudioFormat; +use xmodits_lib::exporter::AudioFormat; use crate::utils::folder_dialog; use crate::widget::helpers::{centered_button, control, labelled_picklist}; @@ -73,7 +73,7 @@ pub fn view_destination_bar(ripping_cfg: &SampleRippingConfig) -> Element(ripping: &'a SampleRippingConfig) -> Element<'a, Message> { +pub fn view(ripping: &SampleRippingConfig) -> Element { let col1 = column![ checkbox( "Self Contained", diff --git a/src/screen/settings.rs b/src/screen/settings.rs index 974cfcc8..c65b2c46 100644 --- a/src/screen/settings.rs +++ b/src/screen/settings.rs @@ -80,7 +80,7 @@ pub fn non_gui(general: &config::GeneralConfig) -> Option> { } #[cfg(not(target_env = "msvc"))] -pub fn non_gui(general: &config::GeneralConfig) -> Option> { +pub fn non_gui(_general: &config::GeneralConfig) -> Option> { None } diff --git a/src/screen/tracker_info.rs b/src/screen/tracker_info.rs index ce4a4c9f..09b420f1 100644 --- a/src/screen/tracker_info.rs +++ b/src/screen/tracker_info.rs @@ -10,7 +10,7 @@ use std::{ use crate::utils::filename; use crate::widget::helpers::{centered_column_x, centered_text, control_filled}; use crate::widget::Element; -use data::xmodits_lib::common::info::Info; +use xmodits_lib::common::info::Info; use iced::widget::{button, column, text, Space}; use crate::app::Message;