pub struct ControlMonitor<'d> { /* private fields */ }Expand description
Control status change monitor.
Await Self::changed, then read the updated settings with Self::muted, Self::volume and Self::sample_rate_hz.
Implementations§
Source§impl<'d> ControlMonitor<'d>
impl<'d> ControlMonitor<'d>
Sourcepub fn muted(&self) -> bool
pub fn muted(&self) -> bool
Whether the host has muted the stream: the master channel, or every audio channel. A stream that honours it plays or sends silence.
Sourcepub fn volume(&self, channel: Channel) -> Option<Volume>
pub fn volume(&self, channel: Channel) -> Option<Volume>
Returns the channel volume with the master volume applied.
Returns Volume::Muted if the master or channel is muted or set to silence (-∞ dB).
Returns None if the channel is absent or neither it nor the master has controls.
Sourcepub fn sample_rate_hz(&self) -> u32
pub fn sample_rate_hz(&self) -> u32
Get the streaming endpoint’s sample rate in Hz. Before the host sets one — and again after a bus reset — it is the first advertised rate.
Auto Trait Implementations§
impl<'d> !RefUnwindSafe for ControlMonitor<'d>
impl<'d> !UnwindSafe for ControlMonitor<'d>
impl<'d> Freeze for ControlMonitor<'d>
impl<'d> Send for ControlMonitor<'d>
impl<'d> Sync for ControlMonitor<'d>
impl<'d> Unpin for ControlMonitor<'d>
impl<'d> UnsafeUnpin for ControlMonitor<'d>
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