Add new DeviceNameError type

The coreaudio and wasapi backends may both potentially fail to produce
the name associated with a device. This changes the API to allow for
returning the errors in these cases.
This commit is contained in:
mitchmindtree 2019-06-21 00:53:11 +02:00
parent 78a7cb9e79
commit 105086a108
6 changed files with 54 additions and 19 deletions

View file

@ -10,6 +10,7 @@ use stdweb::web::set_timeout;
use BuildStreamError;
use DefaultFormatError;
use DeviceNameError;
use DevicesError;
use Format;
use SupportedFormatsError;
@ -229,8 +230,8 @@ pub struct Device;
impl Device {
#[inline]
pub fn name(&self) -> String {
"Default Device".to_owned()
pub fn name(&self) -> Result<String, DeviceNameError> {
Ok("Default Device".to_owned())
}
#[inline]