pub struct AudioDeviceEnumeratorSynchronousProxy { /* private fields */ }
Implementations§
Source§impl AudioDeviceEnumeratorSynchronousProxy
impl AudioDeviceEnumeratorSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<AudioDeviceEnumeratorEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<AudioDeviceEnumeratorEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn get_devices(
&self,
___deadline: MonotonicInstant,
) -> Result<Vec<AudioDeviceInfo>, Error>
pub fn get_devices( &self, ___deadline: MonotonicInstant, ) -> Result<Vec<AudioDeviceInfo>, Error>
Obtain the list of currently active audio devices.
Sourcepub fn get_device_gain(
&self,
device_token: u64,
___deadline: MonotonicInstant,
) -> Result<(u64, AudioGainInfo), Error>
pub fn get_device_gain( &self, device_token: u64, ___deadline: MonotonicInstant, ) -> Result<(u64, AudioGainInfo), Error>
Gain/Mute/AGC control
Note that each of these operations requires a device_token in order to target the proper input/output.
The Get command returns the device_token of the device whose gain is
being reported, or ZX_KOID_INVALID
in the case that the requested
device_token was invalid or the device had been removed from the system
before the Get command could be processed.
Set commands which are given an invalid device token are ignored and have no effect on the system. In addition, users do not need to control all of the gain settings for an audio device with each call. Only the settings with a corresponding flag set in the set_flags parameter will be affected. For example, passing SetAudioGainFlag_MuteValid will cause a SetDeviceGain call to care only about the mute setting in the gain_info structure, while passing (SetAudioGainFlag_GainValid | SetAudioGainFlag_MuteValid) will cause both the mute and the gain status to be changed simultaneously.
pub fn set_device_gain( &self, device_token: u64, gain_info: &AudioGainInfo, valid_flags: AudioGainValidFlags, ) -> Result<(), Error>
Sourcepub fn add_device_by_channel(
&self,
device_name: &str,
is_input: bool,
channel: ClientEnd<StreamConfigMarker>,
) -> Result<(), Error>
pub fn add_device_by_channel( &self, device_name: &str, is_input: bool, channel: ClientEnd<StreamConfigMarker>, ) -> Result<(), Error>
§Deprecation
StreamConfig is not supported anymore, instead use an Audio Composite , see Audio Drivers Architecture
Trait Implementations§
Source§impl SynchronousProxy for AudioDeviceEnumeratorSynchronousProxy
impl SynchronousProxy for AudioDeviceEnumeratorSynchronousProxy
Source§type Proxy = AudioDeviceEnumeratorProxy
type Proxy = AudioDeviceEnumeratorProxy
Source§type Protocol = AudioDeviceEnumeratorMarker
type Protocol = AudioDeviceEnumeratorMarker
Proxy
controls.