pub struct InputDevice {Show 23 fields
pub key: DeviceKey,
pub name: Property<String>,
pub description: Property<String>,
pub card_index: Property<Option<u32>>,
pub owner_module: Property<Option<u32>>,
pub driver: Property<String>,
pub state: Property<DeviceState>,
pub volume: Property<Volume>,
pub base_volume: Property<Volume>,
pub n_volume_steps: Property<u32>,
pub muted: Property<bool>,
pub properties: Property<HashMap<String, String>>,
pub ports: Property<Vec<DevicePort>>,
pub active_port: Property<Option<String>>,
pub formats: Property<Vec<AudioFormat>>,
pub sample_spec: Property<SampleSpec>,
pub channel_map: Property<ChannelMap>,
pub monitor_of_sink: Property<Option<u32>>,
pub monitor_of_sink_name: Property<Option<String>>,
pub is_monitor: Property<bool>,
pub latency: Property<MicroSeconds>,
pub configured_latency: Property<MicroSeconds>,
pub flags: Property<u32>,
/* private fields */
}Expand description
PulseAudio source with reactive properties and control methods.
Instances from AudioService fields are live (properties auto-update).
Instances from AudioService::input_device are snapshots (frozen state).
§Control Methods
set_volume- Adjust input gainset_mute- Mute or unmuteset_port- Switch input portset_as_default- Make this the default input
Fields§
§key: DeviceKeyDevice key for identification
name: Property<String>Device name (internal identifier)
description: Property<String>Human-readable description
card_index: Property<Option<u32>>Card index this device belongs to
owner_module: Property<Option<u32>>Index of the owning module
driver: Property<String>Driver name
state: Property<DeviceState>Device state
volume: Property<Volume>Current volume levels
base_volume: Property<Volume>Base volume (reference level)
n_volume_steps: Property<u32>Number of volume steps for devices which do not support arbitrary volumes
muted: Property<bool>Whether device is muted
properties: Property<HashMap<String, String>>Device properties from PulseAudio
ports: Property<Vec<DevicePort>>Available ports
active_port: Property<Option<String>>Currently active port
formats: Property<Vec<AudioFormat>>Supported audio formats
sample_spec: Property<SampleSpec>Sample specification
channel_map: Property<ChannelMap>Channel map
monitor_of_sink: Property<Option<u32>>Index of the sink being monitored (if this is a monitor source)
monitor_of_sink_name: Property<Option<String>>Name of the sink being monitored (if this is a monitor source)
is_monitor: Property<bool>Whether this is a monitor source
latency: Property<MicroSeconds>Latency in microseconds
configured_latency: Property<MicroSeconds>Configured latency in microseconds
flags: Property<u32>Device flags (raw flags from PulseAudio)
Implementations§
Source§impl InputDevice
impl InputDevice
Sourcepub async fn set_volume(&self, volume: Volume) -> Result<(), Error>
pub async fn set_volume(&self, volume: Volume) -> Result<(), Error>
Set the volume for this input device.
§Errors
Returns error if backend communication fails or device operation fails.
Sourcepub async fn set_mute(&self, muted: bool) -> Result<(), Error>
pub async fn set_mute(&self, muted: bool) -> Result<(), Error>
Set the mute state for this input device.
§Errors
Returns error if backend communication fails or device operation fails.
Trait Implementations§
Source§impl Clone for InputDevice
impl Clone for InputDevice
Source§fn clone(&self) -> InputDevice
fn clone(&self) -> InputDevice
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more