utils as mod
This commit is contained in:
parent
ed50bb9923
commit
91f2edb277
6 changed files with 7 additions and 10 deletions
|
|
@ -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)]
|
||||
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<T>(channels: &[Vec<T>], target: &mut Vec<T>)
|
||||
where
|
||||
T: std::marker::Copy,
|
||||
T: Copy,
|
||||
{
|
||||
assert!(!channels.is_empty());
|
||||
target.clear();
|
||||
|
|
@ -28,7 +30,7 @@ where
|
|||
/// asio: 111122223333
|
||||
pub fn deinterleave<T>(cpal_buffer: &[T], asio_channels: &mut [Vec<T>])
|
||||
where
|
||||
T: std::marker::Copy,
|
||||
T: Copy,
|
||||
{
|
||||
for ch in asio_channels.iter_mut() {
|
||||
ch.clear();
|
||||
|
|
@ -6,3 +6,4 @@ pub use self::stream::{InputBuffer, OutputBuffer, EventLoop, StreamId};
|
|||
|
||||
mod device;
|
||||
mod stream;
|
||||
mod asio_utils;
|
||||
|
|
@ -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<Mutex<sys::AsioStreams>>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue