Struct audio_device::alsa::SoftwareParametersMut[][src]

pub struct SoftwareParametersMut<'a> { /* fields omitted */ }
This is supported on crate feature alsa only.

Collection of mutable software parameters being configured for a Pcm handle.

See Pcm::software_parameters_mut.

Implementations

impl<'a> SoftwareParametersMut<'a>[src]

pub fn install(self) -> Result<()>[src]

Install PCM software configuration defined by params.

Examples

use audio_device::alsa;

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

sw.set_timestamp_mode(alsa::Timestamp::Enable)?;
sw.install()?;

pub fn set_timestamp_mode(&mut self, timestamp_mode: Timestamp) -> Result<()>[src]

Set timestamp mode inside a software configuration container.

Examples

use audio_device::alsa;

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

sw.set_timestamp_mode(alsa::Timestamp::Enable)?;

pub fn set_timestamp_type(
    &mut self,
    timestamp_type: TimestampType
) -> Result<()>
[src]

Set timestamp type inside a software configuration container.

Examples

use audio_device::alsa;

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

sw.set_timestamp_type(alsa::TimestampType::Monotonic)?;

pub fn set_available_min(&mut self, available_min: c_ulong) -> Result<()>[src]

Set avail min inside a software configuration container.

This is similar to setting an OSS wakeup point. The valid values for ‘val’ are determined by the specific hardware. Most PC sound cards can only accept power of 2 frame counts (i.e. 512, 1024, 2048). You cannot use this as a high resolution timer - it is limited to how often the sound card hardware raises an interrupt.

Examples

use audio_device::alsa;

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

sw.set_available_min(1000)?;

pub fn set_period_event(&mut self, period_event: c_int) -> Result<()>[src]

Set period event inside a software configuration container.

An poll (select) wakeup event is raised if enabled.

Examples

use audio_device::alsa;

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

sw.set_period_event(0)?;

pub fn set_start_threshold(&mut self, start_threshold: c_ulong) -> Result<()>[src]

Set start threshold inside a software configuration container.

Examples

use audio_device::alsa;

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

sw.set_start_threshold(0)?;

pub fn set_stop_threshold(&mut self, stop_threshold: c_ulong) -> Result<()>[src]

Set stop threshold inside a software configuration container.

Examples

use audio_device::alsa;

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

sw.set_stop_threshold(0)?;

pub fn set_silence_threshold(
    &mut self,
    silence_threshold: c_ulong
) -> Result<()>
[src]

Set silence threshold inside a software configuration container.

Examples

use audio_device::alsa;

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

sw.set_silence_threshold(0)?;

pub fn set_silence_size(&mut self, silence_size: c_ulong) -> Result<()>[src]

Set silence size inside a software configuration container.

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

The special case is when silence size value is equal or greater than boundary. The unused portion of the ring buffer (initial written samples are untouched) is filled with silence at start. Later, only just processed sample area is filled with silence. Note: silence_threshold must be set to zero.

Examples

use audio_device::alsa;

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

sw.set_silence_size(0)?;

Methods from Deref<Target = SoftwareParameters>

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

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);

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

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);

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

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);

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

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);

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

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()?;

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

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()?;

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

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()?;

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

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()?;

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

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

impl Deref for SoftwareParametersMut<'_>[src]

type Target = SoftwareParameters

The resulting type after dereferencing.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.