pub struct AudioSessionControl { /* private fields */ }Expand description
Struct wrapping an IAudioSessionControl.
Implementations§
Source§impl AudioSessionControl
impl AudioSessionControl
Sourcepub fn get_state(&self) -> Result<SessionState, WasapiError>
pub fn get_state(&self) -> Result<SessionState, WasapiError>
Get the current session state
Sourcepub fn register_session_notification(
&self,
callbacks: EventCallbacks,
) -> Result<EventRegistration, WasapiError>
pub fn register_session_notification( &self, callbacks: EventCallbacks, ) -> Result<EventRegistration, WasapiError>
Register to receive notifications. Returns a EventRegistration struct. The notifications are unregistered when this struct is dropped. Make sure to store the EventRegistration in a variable that remains in scope for as long as the event notifications are needed.
The function takes ownership of the provided EventCallbacks.
Sourcepub fn get_process_id(&self) -> Result<u32, WasapiError>
pub fn get_process_id(&self) -> Result<u32, WasapiError>
Get the id of the process that owns this session.
Sourcepub fn set_ducking_preference(
&self,
preference: bool,
) -> Result<(), WasapiError>
pub fn set_ducking_preference( &self, preference: bool, ) -> Result<(), WasapiError>
Sets the default stream attenuation experience (auto-ducking) provided by the system.
Auto Trait Implementations§
impl Freeze for AudioSessionControl
impl RefUnwindSafe for AudioSessionControl
impl !Send for AudioSessionControl
impl !Sync for AudioSessionControl
impl Unpin for AudioSessionControl
impl UnwindSafe for AudioSessionControl
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