diff --git a/Cargo.toml b/Cargo.toml index e863431..d7f234d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,6 @@ hound = "3.4" [target.'cfg(any(target_os = "windows" ))'.dependencies] asio-sys = { version = "0.1", path = "asio-sys" } -asio_utils = { version = "0.1", path = "src/platform/windows/asio/asio_utils" } [target.'cfg(target_os = "windows")'.dependencies] winapi = { version = "0.3", features = ["audiosessiontypes", "audioclient", "coml2api", "combaseapi", "debug", "devpkey", "handleapi", "ksmedia", "mmdeviceapi", "objbase", "std", "synchapi", "winuser"] } diff --git a/src/platform/windows/asio/asio_utils/Cargo.toml b/src/platform/windows/asio/asio_utils/Cargo.toml deleted file mode 100644 index e949bad..0000000 --- a/src/platform/windows/asio/asio_utils/Cargo.toml +++ /dev/null @@ -1,6 +0,0 @@ -[package] -name = "asio_utils" -version = "0.1.0" -authors = ["Tom Gowan "] - -[dependencies] diff --git a/src/platform/windows/asio/asio_utils/src/lib.rs b/src/platform/windows/asio/asio_utils/mod.rs similarity index 95% rename from src/platform/windows/asio/asio_utils/src/lib.rs rename to src/platform/windows/asio/asio_utils/mod.rs index f9f78fe..c9b221f 100644 --- a/src/platform/windows/asio/asio_utils/src/lib.rs +++ b/src/platform/windows/asio/asio_utils/mod.rs @@ -1,6 +1,8 @@ #[cfg(test)] mod tests; +use std::marker::Copy; + /// Interleave the buffer from asio to cpal /// asio: LLLLRRRR /// cpal: LRLRLRLR @@ -11,7 +13,7 @@ mod tests; /// this check is ommited for performance pub fn interleave(channels: &[Vec], target: &mut Vec) where - T: std::marker::Copy, + T: Copy, { assert!(!channels.is_empty()); target.clear(); @@ -28,7 +30,7 @@ where /// asio: 111122223333 pub fn deinterleave(cpal_buffer: &[T], asio_channels: &mut [Vec]) where - T: std::marker::Copy, + T: Copy, { for ch in asio_channels.iter_mut() { ch.clear(); diff --git a/src/platform/windows/asio/asio_utils/src/tests.rs b/src/platform/windows/asio/asio_utils/tests.rs similarity index 100% rename from src/platform/windows/asio/asio_utils/src/tests.rs rename to src/platform/windows/asio/asio_utils/tests.rs diff --git a/src/platform/windows/asio/mod.rs b/src/platform/windows/asio/mod.rs index 8f98594..1d49f42 100644 --- a/src/platform/windows/asio/mod.rs +++ b/src/platform/windows/asio/mod.rs @@ -6,3 +6,4 @@ pub use self::stream::{InputBuffer, OutputBuffer, EventLoop, StreamId}; mod device; mod stream; +mod asio_utils; \ No newline at end of file diff --git a/src/platform/windows/asio/stream.rs b/src/platform/windows/asio/stream.rs index 5392a96..66ca056 100644 --- a/src/platform/windows/asio/stream.rs +++ b/src/platform/windows/asio/stream.rs @@ -1,5 +1,5 @@ extern crate asio_sys as sys; -extern crate asio_utils as au; + use std; use Format; @@ -12,6 +12,7 @@ use std::sync::{Arc, Mutex}; use std::mem; use std::sync::atomic::{AtomicUsize, Ordering}; use SampleFormat; +use super::asio_utils as au; pub struct EventLoop { asio_streams: Arc>,