From cde47ab9703d6816171de9e6adffee0a7ab720e8 Mon Sep 17 00:00:00 2001 From: Francesco Zardi Date: Wed, 18 Apr 2018 20:39:52 +0200 Subject: [PATCH] Rename `default_endpoint()` to, `default_output_device()`, reexport `default_input_device()` --- examples/basic.rs | 2 +- examples/music_flac.rs | 2 +- examples/music_ogg.rs | 2 +- examples/music_wav.rs | 2 +- examples/reverb.rs | 2 +- examples/spatial.rs | 2 +- src/lib.rs | 8 ++++---- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/basic.rs b/examples/basic.rs index 2e6e5c6..f5058ac 100644 --- a/examples/basic.rs +++ b/examples/basic.rs @@ -5,7 +5,7 @@ use std::thread; use std::time::Duration; fn main() { - let endpoint = rodio::default_endpoint().unwrap(); + let endpoint = rodio::default_output_device().unwrap(); let file = std::fs::File::open("examples/beep.wav").unwrap(); let mut beep1 = rodio::play_once(&endpoint, BufReader::new(file)).unwrap(); diff --git a/examples/music_flac.rs b/examples/music_flac.rs index b1f474c..45bfc18 100644 --- a/examples/music_flac.rs +++ b/examples/music_flac.rs @@ -3,7 +3,7 @@ extern crate rodio; use std::io::BufReader; fn main() { - let endpoint = rodio::default_endpoint().unwrap(); + let endpoint = rodio::default_output_device().unwrap(); let sink = rodio::Sink::new(&endpoint); let file = std::fs::File::open("examples/music.flac").unwrap(); diff --git a/examples/music_ogg.rs b/examples/music_ogg.rs index 4dea283..a52985c 100644 --- a/examples/music_ogg.rs +++ b/examples/music_ogg.rs @@ -3,7 +3,7 @@ extern crate rodio; use std::io::BufReader; fn main() { - let endpoint = rodio::default_endpoint().unwrap(); + let endpoint = rodio::default_output_device().unwrap(); let sink = rodio::Sink::new(&endpoint); let file = std::fs::File::open("examples/music.ogg").unwrap(); diff --git a/examples/music_wav.rs b/examples/music_wav.rs index 621b87c..34bab58 100644 --- a/examples/music_wav.rs +++ b/examples/music_wav.rs @@ -3,7 +3,7 @@ extern crate rodio; use std::io::BufReader; fn main() { - let endpoint = rodio::default_endpoint().unwrap(); + let endpoint = rodio::default_output_device().unwrap(); let sink = rodio::Sink::new(&endpoint); let file = std::fs::File::open("examples/music.wav").unwrap(); diff --git a/examples/reverb.rs b/examples/reverb.rs index fb755f1..5de2e97 100644 --- a/examples/reverb.rs +++ b/examples/reverb.rs @@ -5,7 +5,7 @@ use std::io::BufReader; use std::time::Duration; fn main() { - let endpoint = rodio::default_endpoint().unwrap(); + let endpoint = rodio::default_output_device().unwrap(); let sink = rodio::Sink::new(&endpoint); let file = std::fs::File::open("examples/music.ogg").unwrap(); diff --git a/examples/spatial.rs b/examples/spatial.rs index db43174..eb69db8 100644 --- a/examples/spatial.rs +++ b/examples/spatial.rs @@ -5,7 +5,7 @@ use std::thread; use std::time::Duration; fn main() { - let endpoint = rodio::default_endpoint().unwrap(); + let endpoint = rodio::default_output_device().unwrap(); let mut sink = rodio::SpatialSink::new(&endpoint, [-10.0, 0.0, 0.0], [1.0, 0.0, 0.0], diff --git a/src/lib.rs b/src/lib.rs index 6fcef9d..6e9cecc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,7 @@ //! [decoder](decoder/index.html), etc. or even your own type that implements //! [the `Source` trait](source/trait.Source.html). //! - Choose an output with the [`endpoints`](fn.endpoints.html) or -//! [`default_endpoint`](fn.default_endpoint.html) functions. +//! [`default_output_device`](fn.default_output_device.html) functions. //! - Call [`play_raw(output, source)`](fn.play_raw.html). //! //! The `play_raw` function expects the source to produce `f32`s, which may not be the case. If you @@ -20,7 +20,7 @@ //! use std::io::BufReader; //! use rodio::Source; //! -//! let endpoint = rodio::default_endpoint().unwrap(); +//! let endpoint = rodio::default_output_device().unwrap(); //! //! let file = File::open("sound.ogg").unwrap(); //! let source = rodio::Decoder::new(BufReader::new(file)).unwrap(); @@ -38,7 +38,7 @@ //! ```no_run //! use rodio::Sink; //! -//! let endpoint = rodio::default_endpoint().unwrap(); +//! let endpoint = rodio::default_output_device().unwrap(); //! let sink = Sink::new(&endpoint); //! //! // Add a dummy source of the sake of the example. @@ -94,7 +94,7 @@ extern crate lazy_static; extern crate lewton; extern crate cgmath; -pub use cpal::{Device, default_endpoint, endpoints, get_default_endpoint, get_endpoints_list}; +pub use cpal::{Device, default_output_device, default_input_device, endpoints, get_default_endpoint, get_endpoints_list}; pub use conversions::Sample; pub use decoder::Decoder;