Commit Graph

723 Commits

Author SHA1 Message Date
est31 5fa5ae8cff
Merge pull request #340 from mitchmindtree/thiserror
Switch to dtolnay's `thiserror` for handling error boilerplate
2019-10-13 12:58:52 +02:00
mitchmindtree 7b08cb0dae Update examples for switch to `thiserror`
To compensate for the removal of `failure`'s application friendly
`failure::Error` trait, this `anyhow` crate has been added as a
dev-dependency for the examples, but is by no means a necessity for
other crates downstream of CPAL.
2019-10-13 12:36:49 +02:00
mitchmindtree d9d4a906c9 Switch to dtolnay's `thiserror` for handling error boilerplate
Currently CPAL only really uses `failure` for its `derive` capabilities
and the ability to easily generate implementations for `Display`. That
said there are a few issues with using the `failure` crate:

- `failure` does not provie a `std::error::Error` implementation without
  first converting error types into `failure::Error`.
- It leaks significantly into the public API and expects downstream
  users to also depend on `failure` and the non-std `Fail` trait for
  their own error handling.
- Solved problems such as downcasting of causal errors which have since
  been addressed in `std`.
- Provides application-friendly `Fail` trait and `failure::Error` type,
  not particularly useful to libraries like CPAL.

The [`thiserror` crate](https://github.com/dtolnay/thiserror) is better
targeted towards libraries, does not leak into the public API while
providing easy generation of `Display`, `From` and `std::error::Error`
implementations including proper handling of the newish
`std::error::Error::source` method.
2019-10-13 12:29:21 +02:00
Luni-4 40ded0212d Add cargo-publish job 2019-10-05 11:11:03 +02:00
est31 be54ffff09
Merge pull request #338 from Luni-4/fix-clippy-pr
Enable clippy-check for pull requests
2019-10-05 04:01:25 +02:00
Luni-4 dd091b3310 Enable clippy-check for pull requests 2019-10-04 19:05:34 +02:00
est31 3498336239
Merge pull request #336 from Luni-4/fix-clippy
Fix the clippy-action
2019-10-04 12:32:38 +02:00
Luni-4 4e47c7ea8d Disable the clippy-action for pull requests 2019-10-04 12:20:40 +02:00
Luni-4 8234df7f3d Fix clippy 2019-10-04 11:54:11 +02:00
est31 8f5496b0fd
Merge pull request #335 from Luni-4/github-actions
Add Github Actions
2019-10-03 23:02:18 +02:00
Luni-4 2cd1e0d633 Add Github Actions 2019-10-03 15:59:45 +02:00
est31 712d83fb09
Merge pull request #333 from hatchling13/bugfix
Added winapi feature "winbase" in windows dependencies
2019-10-02 14:30:22 +02:00
est31 5f8618a5cf
Merge pull request #334 from bennetthardwick/fix/readme-build-button
Fix README.md builds badge
2019-10-02 14:03:06 +02:00
Bennett Hardwick 63364fd460 Fix README.md builds badge 2019-10-02 21:54:25 +10:00
Hatchling 5169f53304 Added winapi feature "winbase" in windows dependencies
When using cpal as dependency in other project, it was found that cpal
won't build due to unresolved import of winapi::um::winbase. Added the
feature at line 24 in Cargo.toml.
2019-10-01 14:46:02 +09:00
Tatsuyuki Ishi 43450a6dec
Move errors into separate module (#332)
Move errors into separate module
2019-10-01 11:10:02 +09:00
Tatsuyuki Ishi 4863a00225
Uses ringbuffer in feedback example (#331)
Uses ringbuffer in feedback example
2019-10-01 11:09:49 +09:00
msiglreith edc365f708 Move error into separate module 2019-09-29 14:05:06 +02:00
Mitchell Hentges 1676bf20b6
Adds comment about latency-push unwrap() 2019-09-27 10:18:23 -07:00
Mitchell Hentges 624d1f8ce6
Uses ringbuffer in feedback example 2019-09-26 17:19:12 -07:00
est31 fabf432a1a
Merge pull request #328 from RustAudio/ishitatsuyuki-travis-cache
Travis: enable Cargo cache
2019-09-06 02:45:21 +02:00
Tatsuyuki Ishi ea2421ad36
Travis: enable Cargo cache 2019-09-05 18:19:58 +09:00
Tatsuyuki Ishi 95e9fe0f91
Merge pull request #327 from alexheretic/alsa-set-buffer-near
Alsa: Set buffer size near to 100ms
2019-08-31 21:34:55 +09:00
Alex Butler b1228fc3ff
Alsa: Set buffer size near to 100ms 2019-08-31 13:33:57 +01:00
est31 9e3a19c352
Merge pull request #323 from ishitatsuyuki/alsa-avail-update
Use snd_pcm_avail_update
2019-08-24 07:51:20 +02:00
Tatsuyuki Ishi a5783d14c5 Use snd_pcm_avail_update 2019-08-24 12:32:19 +09:00
est31 447ad5d727
Merge pull request #321 from RustAudio/wasapi-capture
Fix WASAPI capture logic
2019-08-14 00:42:08 +02:00
ishitatsuyuki e9043c605a Fix WASAPI capture logic
The buffer size handling differs from what render streams uses. Logic is based on https://github.com/microsoft/Windows-universal-samples/blob/master/Samples/WindowsAudioSession/cpp/WASAPICapture.cpp.
2019-08-12 10:56:14 +09:00
est31 a1c71b217c
Merge pull request #320 from RustAudio/add-license-1
Create LICENSE
2019-08-11 13:59:29 +02:00
Tatsuyuki Ishi a7df2bd262
Create LICENSE 2019-08-11 20:20:43 +09:00
mitchmindtree d3fdb2dd4b
Merge pull request #307 from derekdreery/relax_buffer_size
Remove the (arbitary) restriction on buffer size
2019-08-10 20:10:24 +02:00
est31 624ca7624f
Update mod.rs (#314)
Fixes #309
2019-08-10 16:42:47 +02:00
est31 6bf00f176a
Merge pull request #317 from est31/remove_uninit
Remove mem::uninitialized() from coreaudio and alsa backends
2019-08-10 15:55:28 +02:00
est31 14c1258a57 Remove uninitalized from coreaudio backend
uninitialized is being deprecated in favour of
MaybeUninit and friends.

In fact, using mem::zeroed() here is the
initialization method that apple docs recommend.

https://developer.apple.com/documentation/coreaudiotypes/audiostreambasicdescription
2019-08-10 15:40:34 +02:00
est31 268ea6cfbf Remove mem::uninitialized from alsa backend
uninitialized is being deprecated in favour of
MaybeUninit and friends.
2019-08-10 15:08:21 +02:00
Richard Dodd (dodj) 684aa6392a
Update mod.rs
Fixes #309
2019-08-04 11:49:15 +01:00
Richard Dodd 1c34dd682e Remove code rather than comment out 2019-07-27 16:41:19 +01:00
Richard Dodd b7d230150c Remove the (arbitary) restriction on buffer size 2019-07-24 20:43:20 +01:00
mitchmindtree a04d869eaa
Merge pull request #305 from ishitatsuyuki/patch-1
Disable Android CI target
2019-07-18 15:19:04 +02:00
mitchmindtree 68bccdb325
Merge pull request #304 from ishitatsuyuki/host-name
Add name to HostId
2019-07-18 15:17:31 +02:00
Tatsuyuki Ishi 474a775ce7
Disable Android CI target
The Android build has been broken for a while; we don't have cfg-gated code for Android anyway for now.
2019-07-18 10:27:31 +09:00
Tatsuyuki Ishi 984ff0fd30 Add name to HostId 2019-07-18 09:46:50 +09:00
mitchmindtree e4ea5e9d06
Merge pull request #300 from ishitatsuyuki/patch-1
Small tweak for ALSA underruns
2019-07-07 12:57:35 +02:00
Tatsuyuki Ishi 447300101d Small tweak for ALSA underruns
The hardcoded errno was replaced by a constant, and `snd_pcm_prepare` was replaced by `snd_pcm_recover` per best practice (the underlying implementation seems same for now, though).
2019-07-07 19:42:08 +09:00
mitchmindtree 0f393f48a5
Merge pull request #298 from mitchmindtree/publish
Update CPAL to version 0.10.0.
2019-07-05 20:29:42 +02:00
mitchmindtree 391b32f5b2 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.
2019-07-05 19:37:17 +02:00
mitchmindtree 6cd7492f4c 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.
2019-07-05 19:28:34 +02:00
mitchmindtree 5b6570e661 Add missing Cargo.toml entries to asio-sys 2019-07-05 19:20:30 +02:00
mitchmindtree 6245dd899c Add some missing re-exports from the platform module into the crate root 2019-07-05 19:20:30 +02:00
mitchmindtree 4cbbcbe316
Merge pull request #293 from EmbarkStudios/master
Bump dependencies
2019-07-05 19:17:07 +02:00