From a6c1b14d6620472cff1d9267b61d9ce09d431fc5 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Thu, 26 Mar 2015 10:03:13 +0100 Subject: [PATCH] Rustup --- Cargo.toml | 2 +- alsa-sys/Cargo.toml | 2 +- alsa-sys/build.rs | 2 +- examples/music.rs | 2 +- src/alsa/mod.rs | 2 +- src/coreaudio/mod.rs | 2 +- src/lib.rs | 12 ++++++------ src/samples_formats.rs | 2 +- src/wasapi/mod.rs | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6ce23e6..c8b052b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cpal" -version = "0.0.16" +version = "0.0.17" authors = ["Pierre Krieger "] description = "Cross-platform audio playing library in pure Rust." repository = "https://github.com/tomaka/cpal" diff --git a/alsa-sys/Cargo.toml b/alsa-sys/Cargo.toml index 91bea7b..b61e3d4 100644 --- a/alsa-sys/Cargo.toml +++ b/alsa-sys/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "alsa-sys" -version = "0.0.5" +version = "0.0.6" authors = ["Pierre Krieger "] build = "build.rs" description = "Bindings for the ALSA project (Advanced Linux Sound Architecture)" diff --git a/alsa-sys/build.rs b/alsa-sys/build.rs index aeb5b80..63221f0 100644 --- a/alsa-sys/build.rs +++ b/alsa-sys/build.rs @@ -1,4 +1,4 @@ -extern crate "pkg-config" as pkg_config; +extern crate pkg_config; fn main() { pkg_config::find_library("alsa").unwrap(); diff --git a/examples/music.rs b/examples/music.rs index b351110..6c39305 100644 --- a/examples/music.rs +++ b/examples/music.rs @@ -14,7 +14,7 @@ fn main() { let packet = packet.unwrap(); let vorbis::Packet { channels, rate, data, .. } = packet; - let mut data = data.as_slice(); + let mut data = &data[..]; loop { if data.len() == 0 { diff --git a/src/alsa/mod.rs b/src/alsa/mod.rs index f086e8e..9c40dc5 100644 --- a/src/alsa/mod.rs +++ b/src/alsa/mod.rs @@ -1,4 +1,4 @@ -extern crate "alsa-sys" as alsa; +extern crate alsa_sys as alsa; extern crate libc; use std::{ffi, iter, mem}; diff --git a/src/coreaudio/mod.rs b/src/coreaudio/mod.rs index 1375675..abbfa8c 100644 --- a/src/coreaudio/mod.rs +++ b/src/coreaudio/mod.rs @@ -1,4 +1,4 @@ -extern crate "coreaudio-rs" as coreaudio; +extern crate coreaudio_rs as coreaudio; extern crate libc; use self::coreaudio::audio_unit::{AudioUnit, Type, SubType}; diff --git a/src/lib.rs b/src/lib.rs index 135d01e..c598016 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -47,7 +47,7 @@ a conversion on your data. If you have the possibility, you should try to match the format of the voice. */ -#![feature(box_syntax, core, unsafe_destructor)] +#![feature(box_syntax, core, unsafe_destructor, thread_sleep, std_misc)] #![unstable] pub use samples_formats::{SampleFormat, Sample}; @@ -269,14 +269,14 @@ impl<'a, T> Drop for Buffer<'a, T> where T: Sample { let buffer = conversion.intermediate_buffer; let buffer = if conversion.from_channels != conversion.to_channels { - conversions::convert_channels(buffer.as_slice(), conversion.from_channels, + conversions::convert_channels(&buffer, conversion.from_channels, conversion.to_channels) } else { buffer }; let buffer = if conversion.from_sample_rate != conversion.to_sample_rate { - conversions::convert_samples_rate(buffer.as_slice(), conversion.from_sample_rate, + conversions::convert_samples_rate(&buffer, conversion.from_sample_rate, conversion.to_sample_rate, conversion.to_channels) } else { @@ -309,15 +309,15 @@ impl<'a, T> Drop for Buffer<'a, T> where T: Sample { match conversion.to_format { SampleFormat::I16 => { - let buffer = Sample::to_vec_i16(buffer.as_slice()); + let buffer = Sample::to_vec_i16(&buffer); write_to_buf!(buffer, output, i16); }, SampleFormat::U16 => { - let buffer = Sample::to_vec_u16(buffer.as_slice()); + let buffer = Sample::to_vec_u16(&buffer); write_to_buf!(buffer, output, u16); }, SampleFormat::F32 => { - let buffer = Sample::to_vec_f32(buffer.as_slice()); + let buffer = Sample::to_vec_f32(&buffer); write_to_buf!(buffer, output, f32); }, } diff --git a/src/samples_formats.rs b/src/samples_formats.rs index d9ecee4..d5d6287 100644 --- a/src/samples_formats.rs +++ b/src/samples_formats.rs @@ -63,7 +63,7 @@ impl Sample for u16 { } fn to_vec_f32(input: &[u16]) -> Cow<[f32]> { - Cow::Owned(Sample::to_vec_f32(Sample::to_vec_i16(input).as_slice()).to_vec()) + Cow::Owned(Sample::to_vec_f32(&Sample::to_vec_i16(input)).to_vec()) } } diff --git a/src/wasapi/mod.rs b/src/wasapi/mod.rs index 7d58910..bb43d65 100644 --- a/src/wasapi/mod.rs +++ b/src/wasapi/mod.rs @@ -1,6 +1,6 @@ extern crate libc; extern crate winapi; -extern crate "ole32-sys" as ole32; +extern crate ole32_sys as ole32; use std::{slice, mem, ptr}; use std::marker::PhantomData;