From 523d25ad49ecfe71fc75230a6454c9d7b7cebf5d Mon Sep 17 00:00:00 2001 From: Tom Gowan Date: Tue, 6 Nov 2018 12:33:07 +1100 Subject: [PATCH] remove u16 --- src/platform/windows/asio/stream.rs | 30 +++++------------------------ 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/src/platform/windows/asio/stream.rs b/src/platform/windows/asio/stream.rs index db90da7..16686db 100644 --- a/src/platform/windows/asio/stream.rs +++ b/src/platform/windows/asio/stream.rs @@ -58,11 +58,13 @@ struct I16Buffer { // TODO This never gets used as there is // no usigned variants of ASIO buffers // and can probably be removed. +/* #[derive(Default)] struct U16Buffer { cpal: Vec, channel: Vec>, } +*/ #[derive(Default)] struct F32Buffer { cpal: Vec, @@ -70,7 +72,7 @@ struct F32Buffer { } struct Buffers { i16_buff: I16Buffer, - u16_buff: U16Buffer, + //u16_buff: U16Buffer, f32_buff: F32Buffer, } @@ -222,22 +224,10 @@ impl EventLoop { .map(|_| Vec::with_capacity(channel_len)) .collect(), }, - u16_buff: U16Buffer::default(), - f32_buff: F32Buffer::default(), - }, - SampleFormat::U16 => Buffers { - i16_buff: I16Buffer::default(), - u16_buff: U16Buffer { - cpal: vec![0 as u16; cpal_num_samples], - channel: (0 .. num_channels) - .map(|_| Vec::with_capacity(channel_len)) - .collect(), - }, f32_buff: F32Buffer::default(), }, SampleFormat::F32 => Buffers { i16_buff: I16Buffer::default(), - u16_buff: U16Buffer::default(), f32_buff: F32Buffer { cpal: vec![0 as f32; cpal_num_samples], channel: (0 .. num_channels) @@ -245,6 +235,7 @@ impl EventLoop { .collect(), }, }, + _ => unimplemented!(), }; // Set the input callback. @@ -521,22 +512,10 @@ impl EventLoop { .map(|_| Vec::with_capacity(channel_len)) .collect(), }, - u16_buff: U16Buffer::default(), - f32_buff: F32Buffer::default(), - }, - SampleFormat::U16 => Buffers { - i16_buff: I16Buffer::default(), - u16_buff: U16Buffer { - cpal: vec![0 as u16; cpal_num_samples], - channel: (0 .. num_channels) - .map(|_| Vec::with_capacity(channel_len)) - .collect(), - }, f32_buff: F32Buffer::default(), }, SampleFormat::F32 => Buffers { i16_buff: I16Buffer::default(), - u16_buff: U16Buffer::default(), f32_buff: F32Buffer { cpal: vec![0 as f32; cpal_num_samples], channel: (0 .. num_channels) @@ -544,6 +523,7 @@ impl EventLoop { .collect(), }, }, + _ => unimplemented!(), }; sys::set_callback(move |index| unsafe {