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:
parent
78a7cb9e79
commit
105086a108
6 changed files with 54 additions and 19 deletions
|
|
@ -7,6 +7,7 @@ use ChannelCount;
|
|||
use BackendSpecificError;
|
||||
use BuildStreamError;
|
||||
use DefaultFormatError;
|
||||
use DeviceNameError;
|
||||
use Format;
|
||||
use SupportedFormatsError;
|
||||
use SampleFormat;
|
||||
|
|
@ -74,8 +75,8 @@ pub struct Device(String);
|
|||
|
||||
impl Device {
|
||||
#[inline]
|
||||
pub fn name(&self) -> String {
|
||||
self.0.clone()
|
||||
pub fn name(&self) -> Result<String, DeviceNameError> {
|
||||
Ok(self.0.clone())
|
||||
}
|
||||
|
||||
unsafe fn supported_formats(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue