use std::fmt;
use crate::{AudioError, DeviceInfo};
pub trait AudioDevice: Sized + fmt::Display {
fn from_default() -> Result<Self, AudioError>;
fn from_id(id: &str) -> Result<Self, AudioError>;
fn from_name(name: &str) -> Result<Self, AudioError>;
fn list() -> Result<Vec<DeviceInfo>, AudioError>;
fn get_vol(&self) -> Result<u8, AudioError>;
fn set_vol(&self, vol: u8) -> Result<(), AudioError>;
fn is_mute(&self) -> Result<bool, AudioError>;
fn set_mute(&self, muted: bool) -> Result<(), AudioError>;
fn id(&self) -> &str;
fn name(&self) -> &str;
}