SoftwareParameters

Struct SoftwareParameters 

Source
pub struct SoftwareParameters { /* private fields */ }
Available on crate feature alsa only.
Expand description

Collection of software parameters being configured for a Pcm handle.

See Pcm::software_parameters.

Implementations§

Source§

impl SoftwareParameters

Source

pub fn copy(&mut self, other: &SoftwareParameters)

Copy one set of software parameters to another.

§Examples
use audio_device::alsa;

let mut a = alsa::Pcm::open_default(alsa::Stream::Playback)?;
let mut b = alsa::Pcm::open_default(alsa::Stream::Playback)?;

let a = a.software_parameters()?;
let mut b = b.software_parameters()?;

b.copy(&a);
Source

pub fn boundary(&self) -> Result<c_ulong>

Get boundary for ring pointers from a software configuration container.

§Examples
use audio_device::alsa;

let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?;
let sw = pcm.software_parameters()?;

let boundary = sw.boundary()?;
dbg!(boundary);
Source

pub fn timestamp_mode(&self) -> Result<Timestamp>

Get timestamp mode from a software configuration container.

§Examples
use audio_device::alsa;

let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?;
let sw = pcm.software_parameters()?;

let timestamp_mode = sw.timestamp_mode()?;
dbg!(timestamp_mode);
Source

pub fn timestamp_type(&self) -> Result<TimestampType>

Get timestamp type from a software configuration container.

§Examples
use audio_device::alsa;

let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?;
let sw = pcm.software_parameters()?;

let value = sw.timestamp_type()?;
dbg!(value);
Source

pub fn available_min(&self) -> Result<c_ulong>

Get avail min from a software configuration container.

§Examples
use audio_device::alsa;

let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?;
let sw = pcm.software_parameters()?;

let available_min = sw.available_min()?;
dbg!(available_min);
Source

pub fn period_event(&self) -> Result<c_int>

Get period event from a software configuration container.

§Examples
use audio_device::alsa;

let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?;
let sw = pcm.software_parameters()?;

let value = sw.period_event()?;
Source

pub fn start_threshold(&self) -> Result<c_ulong>

Get start threshold from a software configuration container.

§Examples
use audio_device::alsa;

let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?;
let sw = pcm.software_parameters()?;

let value = sw.start_threshold()?;
Source

pub fn stop_threshold(&self) -> Result<c_ulong>

Get stop threshold from a software configuration container.

§Examples
use audio_device::alsa;

let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?;
let sw = pcm.software_parameters()?;

let value = sw.stop_threshold()?;
Source

pub fn silence_threshold(&self) -> Result<c_ulong>

Get silence threshold from a software configuration container.

A portion of playback buffer is overwritten with silence (see set_silence_size) when playback underrun is nearer than silence threshold.

§Examples
use audio_device::alsa;

let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?;
let sw = pcm.software_parameters()?;

let value = sw.silence_threshold()?;
Source

pub fn silence_size(&self) -> Result<c_ulong>

Get silence size from a software configuration container.

§Examples
use audio_device::alsa;

let mut pcm = alsa::Pcm::open_default(alsa::Stream::Playback)?;
let sw = pcm.software_parameters()?;

let value = sw.silence_size()?;

Trait Implementations§

Source§

impl Drop for SoftwareParameters

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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

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.