From 6245dd899cef5b7ee0f2f7f800c6b5f21dd0abf2 Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Fri, 5 Jul 2019 19:10:53 +0200 Subject: [PATCH 1/4] Add some missing re-exports from the platform module into the crate root --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 244be18..0089ec5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -150,8 +150,8 @@ extern crate lazy_static; extern crate stdweb; pub use platform::{ - ALL_HOSTS, Device, EventLoop, Host, HostId, StreamId, available_hosts, - default_host, host_from_id, + ALL_HOSTS, Device, Devices, EventLoop, Host, HostId, SupportedInputFormats, + SupportedOutputFormats, StreamId, available_hosts, default_host, host_from_id, }; pub use samples_formats::{Sample, SampleFormat}; From 5b6570e661b335fddaeb3306b743d17fc7457aeb Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Fri, 5 Jul 2019 19:20:23 +0200 Subject: [PATCH 2/4] Add missing Cargo.toml entries to asio-sys --- asio-sys/Cargo.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/asio-sys/Cargo.toml b/asio-sys/Cargo.toml index b1208d5..7a92552 100644 --- a/asio-sys/Cargo.toml +++ b/asio-sys/Cargo.toml @@ -2,6 +2,11 @@ name = "asio-sys" version = "0.1.0" authors = ["Tom Gowan "] +description = "Low-level interface and binding generation for the steinberg ASIO SDK." +repository = "https://github.com/tomaka/cpal" +documentation = "https://docs.rs/asio-sys" +license = "Apache-2.0" +keywords = ["audio", "sound", "asio", "steinberg"] build = "build.rs" [target.'cfg(any(target_os = "windows"))'.build-dependencies] From 6cd7492f4cd4c7ca27524e32b57742c63b8c2895 Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Fri, 5 Jul 2019 19:28:34 +0200 Subject: [PATCH 3/4] Add missing `Hash` constraint to `StreamId` This existed prior to the introduction of the `Host` API, but was lost in translation. This re-adds the bounds so that downstream code does not suddenly break due to a lacking `Hash` implementation in the next CPAL version. --- src/platform/mod.rs | 4 ++-- src/traits.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/mod.rs b/src/platform/mod.rs index 314705d..3957168 100644 --- a/src/platform/mod.rs +++ b/src/platform/mod.rs @@ -64,7 +64,7 @@ macro_rules! impl_platform_host { /// The **StreamId** implementation associated with the platform's dynamically dispatched /// **Host** type. - #[derive(Clone, Debug, Eq, PartialEq)] + #[derive(Clone, Debug, Eq, Hash, PartialEq)] pub struct StreamId(StreamIdInner); /// The **SupportedInputFormats** iterator associated with the platform's dynamically @@ -107,7 +107,7 @@ macro_rules! impl_platform_host { )* } - #[derive(Clone, Debug, Eq, PartialEq)] + #[derive(Clone, Debug, Eq, Hash, PartialEq)] enum StreamIdInner { $( $HostVariant(crate::host::$host_mod::StreamId), diff --git a/src/traits.rs b/src/traits.rs index fb48829..f50764e 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -195,4 +195,4 @@ pub trait EventLoopTrait { } /// The set of required bounds for host `StreamId` types. -pub trait StreamIdTrait: Clone + std::fmt::Debug + PartialEq + Eq {} +pub trait StreamIdTrait: Clone + std::fmt::Debug + std::hash::Hash + PartialEq + Eq {} From 391b32f5b2704141506eb4fcb827b8de76e77d54 Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Fri, 5 Jul 2019 19:29:47 +0200 Subject: [PATCH 4/4] Update CPAL to version 0.10.0. This is quite a significant update for CPAL, including a number of breaking changes. Here is a list of the breaking changes along with links to where you can find more information: - A `Host` API has been introduced in #289 along with a follow-up refactor in #295. Please see the examples for a demonstration of how to update your code. The necessary changes should hopefully be minimal. If this has caused you any major difficulty please let us know in an issue! - An ASIO host has been introduced in #292. This adds support for Steinberg's ASIO audio driver API on Windows. Please see the ASIO section of the README for more information on how to setup CPAL with ASIO support for your project. - The user callback API has been overhauled to emit `StreamEvent`s rather than buffers in order to support handling stream errors. #288. - Error handling in general was overhauled in #286. This meant taking advantage of the `failure` crate and adding support for backend-specific errors with custom messages. Many unnecessary `panic!`s have been removed, but a few remain that would indicate bugs in CPAL. In general, checking out the updated examples will be the easiest way to get a quick overview on how you can update your own code for these changes. The CHANGELOG.md has been updated to include these changes. --- CHANGELOG.md | 11 +++++++++++ Cargo.toml | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9eb785d..721f3e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Unreleased +# Version 0.10.0 (2019-07-05) + +- core-foundation-sys and coreaudio-rs version bumps. +- Add an ASIO host, available under Windows. +- Introduce a new Host API, adding support for alternative audio APIs. +- Remove sleep loop on macOS in favour of using a `Condvar`. +- Allow users to handle stream callback errors with a new `StreamEvent` type. +- Overhaul error handling throughout the crate. +- Remove unnecessary Mutex from ALSA and WASAPI backends in favour of channels. +- Remove `panic!` from OutputBuffer Deref impl as it is no longer necessary. + # Version 0.9.0 (2019-06-06) - Better buffer handling diff --git a/Cargo.toml b/Cargo.toml index f887bd3..00f9614 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "cpal" -version = "0.9.0" +version = "0.10.0" authors = ["The CPAL contributors", "Pierre Krieger "] -description = "Low-level cross-platform audio playing library in pure Rust." +description = "Low-level cross-platform audio I/O library in pure Rust." repository = "https://github.com/tomaka/cpal" documentation = "https://docs.rs/cpal" license = "Apache-2.0"