DeviceInfo

Struct DeviceInfo 

Source
pub struct DeviceInfo {
Show 22 fields pub index: u32, pub name: Option<String>, pub description: Option<String>, pub sample_spec: Spec, pub channel_map: Map, pub owner_module: Option<u32>, pub volume: ChannelVolumes, pub mute: bool, pub monitor: Option<u32>, pub monitor_name: Option<String>, pub latency: MicroSeconds, pub driver: Option<String>, pub flags: Flags, pub proplist: Proplist, pub configured_latency: MicroSeconds, pub base_volume: Volume, pub state: DevState, pub n_volume_steps: u32, pub card: Option<u32>, pub ports: Vec<DevicePortInfo>, pub active_port: Option<DevicePortInfo>, pub formats: Vec<Info>,
}

Fields§

§index: u32

Index of the sink.

§name: Option<String>

Name of the sink.

§description: Option<String>

Description of this sink.

§sample_spec: Spec

Sample spec of this sink.

§channel_map: Map

Channel map.

§owner_module: Option<u32>

Index of the owning module of this sink, or None if is invalid.

§volume: ChannelVolumes

Volume of the sink.

§mute: bool

Mute switch of the sink.

§monitor: Option<u32>

Index of the monitor source connected to this sink.

§monitor_name: Option<String>

The name of the monitor source.

§latency: MicroSeconds

Length of queued audio in the output buffer.

§driver: Option<String>

Driver name.

§flags: Flags

Flags.

§proplist: Proplist

Property list.

§configured_latency: MicroSeconds

The latency this device has been configured to.

§base_volume: Volume

Some kind of “base” volume that refers to unamplified/unattenuated volume in the context of the output device.

§state: DevState

State.

§n_volume_steps: u32

Number of volume steps for sinks which do not support arbitrary volumes.

§card: Option<u32>

Card index, or None if invalid.

§ports: Vec<DevicePortInfo>

Set of available ports.

§active_port: Option<DevicePortInfo>§formats: Vec<Info>

Set of formats supported by the sink.

Trait Implementations§

Source§

impl Clone for DeviceInfo

Source§

fn clone(&self) -> DeviceInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl DeviceControl<DeviceInfo> for SinkController

Source§

fn get_default_device(&mut self) -> Result<DeviceInfo, ControllerError>

Source§

fn set_default_device(&mut self, name: &str) -> Result<bool, ControllerError>

Source§

fn list_devices(&mut self) -> Result<Vec<DeviceInfo>, ControllerError>

Source§

fn get_device_by_index( &mut self, index: u32, ) -> Result<DeviceInfo, ControllerError>

Source§

fn get_device_by_name( &mut self, name: &str, ) -> Result<DeviceInfo, ControllerError>

Source§

fn set_device_volume_by_index(&mut self, index: u32, volume: &ChannelVolumes)

Source§

fn set_device_volume_by_name(&mut self, name: &str, volume: &ChannelVolumes)

Source§

fn set_device_mute_by_index(&mut self, index: u32, mute: bool)

Source§

fn set_device_mute_by_name(&mut self, name: &str, mute: bool)

Source§

fn increase_device_volume_by_percent(&mut self, index: u32, delta: f64)

Source§

fn decrease_device_volume_by_percent(&mut self, index: u32, delta: f64)

Source§

impl DeviceControl<DeviceInfo> for SourceController

Source§

fn get_default_device(&mut self) -> Result<DeviceInfo, ControllerError>

Source§

fn set_default_device(&mut self, name: &str) -> Result<bool, ControllerError>

Source§

fn list_devices(&mut self) -> Result<Vec<DeviceInfo>, ControllerError>

Source§

fn get_device_by_index( &mut self, index: u32, ) -> Result<DeviceInfo, ControllerError>

Source§

fn get_device_by_name( &mut self, name: &str, ) -> Result<DeviceInfo, ControllerError>

Source§

fn set_device_volume_by_index(&mut self, index: u32, volume: &ChannelVolumes)

Source§

fn set_device_volume_by_name(&mut self, name: &str, volume: &ChannelVolumes)

Source§

fn increase_device_volume_by_percent(&mut self, index: u32, delta: f64)

Source§

fn set_device_mute_by_index(&mut self, index: u32, mute: bool)

Source§

fn set_device_mute_by_name(&mut self, name: &str, mute: bool)

Source§

fn decrease_device_volume_by_percent(&mut self, index: u32, delta: f64)

Source§

impl<'a> From<&'a SinkInfo<'a>> for DeviceInfo

Source§

fn from(item: &'a SinkInfo<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<&'a SourceInfo<'a>> for DeviceInfo

Source§

fn from(item: &'a SourceInfo<'a>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.