utils as mod
This commit is contained in:
parent
ed50bb9923
commit
91f2edb277
|
@ -17,7 +17,6 @@ hound = "3.4"
|
||||||
|
|
||||||
[target.'cfg(any(target_os = "windows" ))'.dependencies]
|
[target.'cfg(any(target_os = "windows" ))'.dependencies]
|
||||||
asio-sys = { version = "0.1", path = "asio-sys" }
|
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]
|
[target.'cfg(target_os = "windows")'.dependencies]
|
||||||
winapi = { version = "0.3", features = ["audiosessiontypes", "audioclient", "coml2api", "combaseapi", "debug", "devpkey", "handleapi", "ksmedia", "mmdeviceapi", "objbase", "std", "synchapi", "winuser"] }
|
winapi = { version = "0.3", features = ["audiosessiontypes", "audioclient", "coml2api", "combaseapi", "debug", "devpkey", "handleapi", "ksmedia", "mmdeviceapi", "objbase", "std", "synchapi", "winuser"] }
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
[package]
|
|
||||||
name = "asio_utils"
|
|
||||||
version = "0.1.0"
|
|
||||||
authors = ["Tom Gowan <s3549186@student.rmit.edu.au>"]
|
|
||||||
|
|
||||||
[dependencies]
|
|
|
@ -1,6 +1,8 @@
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests;
|
mod tests;
|
||||||
|
|
||||||
|
use std::marker::Copy;
|
||||||
|
|
||||||
/// Interleave the buffer from asio to cpal
|
/// Interleave the buffer from asio to cpal
|
||||||
/// asio: LLLLRRRR
|
/// asio: LLLLRRRR
|
||||||
/// cpal: LRLRLRLR
|
/// cpal: LRLRLRLR
|
||||||
|
@ -11,7 +13,7 @@ mod tests;
|
||||||
/// this check is ommited for performance
|
/// this check is ommited for performance
|
||||||
pub fn interleave<T>(channels: &[Vec<T>], target: &mut Vec<T>)
|
pub fn interleave<T>(channels: &[Vec<T>], target: &mut Vec<T>)
|
||||||
where
|
where
|
||||||
T: std::marker::Copy,
|
T: Copy,
|
||||||
{
|
{
|
||||||
assert!(!channels.is_empty());
|
assert!(!channels.is_empty());
|
||||||
target.clear();
|
target.clear();
|
||||||
|
@ -28,7 +30,7 @@ where
|
||||||
/// asio: 111122223333
|
/// asio: 111122223333
|
||||||
pub fn deinterleave<T>(cpal_buffer: &[T], asio_channels: &mut [Vec<T>])
|
pub fn deinterleave<T>(cpal_buffer: &[T], asio_channels: &mut [Vec<T>])
|
||||||
where
|
where
|
||||||
T: std::marker::Copy,
|
T: Copy,
|
||||||
{
|
{
|
||||||
for ch in asio_channels.iter_mut() {
|
for ch in asio_channels.iter_mut() {
|
||||||
ch.clear();
|
ch.clear();
|
|
@ -6,3 +6,4 @@ pub use self::stream::{InputBuffer, OutputBuffer, EventLoop, StreamId};
|
||||||
|
|
||||||
mod device;
|
mod device;
|
||||||
mod stream;
|
mod stream;
|
||||||
|
mod asio_utils;
|
|
@ -1,5 +1,5 @@
|
||||||
extern crate asio_sys as sys;
|
extern crate asio_sys as sys;
|
||||||
extern crate asio_utils as au;
|
|
||||||
|
|
||||||
use std;
|
use std;
|
||||||
use Format;
|
use Format;
|
||||||
|
@ -12,6 +12,7 @@ use std::sync::{Arc, Mutex};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||||
use SampleFormat;
|
use SampleFormat;
|
||||||
|
use super::asio_utils as au;
|
||||||
|
|
||||||
pub struct EventLoop {
|
pub struct EventLoop {
|
||||||
asio_streams: Arc<Mutex<sys::AsioStreams>>,
|
asio_streams: Arc<Mutex<sys::AsioStreams>>,
|
||||||
|
|
Loading…
Reference in New Issue