pub struct MiniDSP<'a> {
pub client: Client,
pub device: &'a Device,
/* private fields */
}
Expand description
High-level MiniDSP Control API
Fields§
§client: Client
§device: &'a Device
Implementations§
Source§impl<'a> MiniDSP<'a>
impl<'a> MiniDSP<'a>
pub fn from_client( client: Client, device: &'a Device, device_info: DeviceInfo, ) -> Self
Source§impl MiniDSP<'_>
impl MiniDSP<'_>
Sourcepub async fn get_master_status(&self) -> Result<MasterStatus>
pub async fn get_master_status(&self) -> Result<MasterStatus>
Returns a MasterStatus
object containing the current state
pub async fn subscribe_master_status( &self, ) -> Result<impl Stream<Item = MasterStatus> + 'static, MiniDSPError>
pub async fn get_input_output_levels(&self) -> Result<(Vec<f32>, Vec<f32>)>
Sourcepub async fn get_input_levels(&self) -> Result<Vec<f32>>
pub async fn get_input_levels(&self) -> Result<Vec<f32>>
Gets the current input levels
Sourcepub async fn get_output_levels(&self) -> Result<Vec<f32>>
pub async fn get_output_levels(&self) -> Result<Vec<f32>>
Gets the current output levels
Sourcepub async fn set_master_volume(&self, value: Gain) -> Result<()>
pub async fn set_master_volume(&self, value: Gain) -> Result<()>
Sets the current master volume
Sourcepub async fn set_master_mute(&self, value: bool) -> Result<()>
pub async fn set_master_mute(&self, value: bool) -> Result<()>
Sets the current master mute status
Sourcepub async fn set_source(&self, source: Source) -> Result<()>
pub async fn set_source(&self, source: Source) -> Result<()>
Sets the current input source
Sourcepub async fn set_config(&self, config: u8) -> Result<()>
pub async fn set_config(&self, config: u8) -> Result<()>
Sets the active configuration
Sourcepub fn input(&self, index: usize) -> Result<Input<'_>>
pub fn input(&self, index: usize) -> Result<Input<'_>>
Gets an object wrapping an input channel
Sourcepub fn output(&self, index: usize) -> Result<Output<'_>>
pub fn output(&self, index: usize) -> Result<Output<'_>>
Gets an object wrapping an output channel
Sourcepub async fn get_device_info(&self) -> Result<DeviceInfo>
pub async fn get_device_info(&self) -> Result<DeviceInfo>
Gets the hardware id and dsp version, used internally to determine per-device configuration
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for MiniDSP<'a>
impl<'a> !RefUnwindSafe for MiniDSP<'a>
impl<'a> Send for MiniDSP<'a>
impl<'a> Sync for MiniDSP<'a>
impl<'a> Unpin for MiniDSP<'a>
impl<'a> !UnwindSafe for MiniDSP<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more