Struct alsa::mixer::Selem

source ·
pub struct Selem<'a>(/* private fields */);
Expand description

Wraps an Elem as a Selem

Implementations§

source§

impl<'a> Selem<'a>

source

pub fn new(elem: Elem<'a>) -> Option<Selem<'a>>

Creates a Selem by wrapping elem.

source

pub fn register(mixer: &mut Mixer) -> Result<()>

TODO: This function might change to support regopt and to return the mixer class

source

pub fn get_id(&self) -> SelemId

source

pub fn has_capture_volume(&self) -> bool

source

pub fn has_capture_switch(&self) -> bool

source

pub fn has_playback_volume(&self) -> bool

source

pub fn has_playback_switch(&self) -> bool

source

pub fn can_capture(&self) -> bool

source

pub fn can_playback(&self) -> bool

source

pub fn has_volume(&self) -> bool

source

pub fn get_capture_volume_range(&self) -> (i64, i64)

returns range for capture volume as (min, max) values

source

pub fn get_capture_db_range(&self) -> (MilliBel, MilliBel)

returns (min, max) values.

source

pub fn get_playback_volume_range(&self) -> (i64, i64)

returns (min, max) values.

source

pub fn get_playback_db_range(&self) -> (MilliBel, MilliBel)

returns (min, max) values.

source

pub fn is_capture_mono(&self) -> bool

source

pub fn is_playback_mono(&self) -> bool

source

pub fn has_capture_channel(&self, channel: SelemChannelId) -> bool

source

pub fn has_playback_channel(&self, channel: SelemChannelId) -> bool

source

pub fn channel_name(channel: SelemChannelId) -> Result<&'static str>

Gets name from snd_mixer_selem_channel_name

source

pub fn get_playback_volume(&self, channel: SelemChannelId) -> Result<i64>

source

pub fn get_playback_vol_db(&self, channel: SelemChannelId) -> Result<MilliBel>

returns volume in millibels.

source

pub fn ask_playback_vol_db(&self, volume: i64) -> Result<MilliBel>

Asks alsa to convert playback volume to millibels.

source

pub fn ask_playback_db_vol(&self, db: MilliBel, dir: Round) -> Result<i64>

source

pub fn get_capture_volume(&self, channel: SelemChannelId) -> Result<i64>

source

pub fn get_capture_vol_db(&self, channel: SelemChannelId) -> Result<MilliBel>

returns volume in millibels.

source

pub fn ask_capture_vol_db(&self, volume: i64) -> Result<MilliBel>

Asks alsa to convert capture volume to millibels

source

pub fn ask_capture_db_vol(&self, db: MilliBel, dir: Round) -> Result<i64>

source

pub fn set_playback_volume( &self, channel: SelemChannelId, value: i64 ) -> Result<()>

source

pub fn set_playback_volume_range(&self, min: i64, max: i64) -> Result<()>

source

pub fn set_playback_volume_all(&self, value: i64) -> Result<()>

source

pub fn set_playback_db( &self, channel: SelemChannelId, value: MilliBel, dir: Round ) -> Result<()>

source

pub fn set_capture_db( &self, channel: SelemChannelId, value: MilliBel, dir: Round ) -> Result<()>

source

pub fn set_playback_db_all(&self, value: MilliBel, dir: Round) -> Result<()>

source

pub fn set_capture_db_all(&self, value: MilliBel, dir: Round) -> Result<()>

source

pub fn set_capture_volume( &self, channel: SelemChannelId, value: i64 ) -> Result<()>

source

pub fn set_capture_volume_range(&self, min: i64, max: i64) -> Result<()>

source

pub fn set_capture_volume_all(&self, value: i64) -> Result<()>

source

pub fn set_playback_switch( &self, channel: SelemChannelId, value: i32 ) -> Result<()>

source

pub fn set_playback_switch_all(&self, value: i32) -> Result<()>

source

pub fn set_capture_switch( &self, channel: SelemChannelId, value: i32 ) -> Result<()>

source

pub fn set_capture_switch_all(&self, value: i32) -> Result<()>

source

pub fn get_playback_switch(&self, channel: SelemChannelId) -> Result<i32>

source

pub fn get_capture_switch(&self, channel: SelemChannelId) -> Result<i32>

source

pub fn is_enumerated(&self) -> bool

source

pub fn is_enum_playback(&self) -> bool

source

pub fn is_enum_capture(&self) -> bool

source

pub fn get_enum_items(&self) -> Result<u32>

source

pub fn get_enum_item_name(&self, idx: u32) -> Result<String>

source

pub fn iter_enum(&self) -> Result<IterEnum<'_>>

Enumerates over valid Enum values

source

pub fn get_enum_item(&self, channel: SelemChannelId) -> Result<u32>

source

pub fn set_enum_item(&self, channel: SelemChannelId, idx: u32) -> Result<()>

Trait Implementations§

source§

impl<'a> Deref for Selem<'a>

source§

fn deref(&self) -> &Elem<'a>

returns the elem of this selem

§

type Target = Elem<'a>

The resulting type after dereferencing.

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Selem<'a>

§

impl<'a> !Send for Selem<'a>

§

impl<'a> !Sync for Selem<'a>

§

impl<'a> Unpin for Selem<'a>

§

impl<'a> UnwindSafe for Selem<'a>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.