Struct sdl2::audio::AudioQueue

source ·
pub struct AudioQueue<Channel: AudioFormatNum> { /* private fields */ }
Expand description

Wraps SDL_AudioDeviceID and owns the callback data used by the audio device.

Implementations§

source§

impl<'a, Channel: AudioFormatNum> AudioQueue<Channel>

source

pub fn open_queue<D: Into<Option<&'a str>>>( a: &AudioSubsystem, device: D, spec: &AudioSpecDesired, ) -> Result<AudioQueue<Channel>, String>

Opens a new audio device given the desired parameters and callback.

source

pub fn subsystem(&self) -> &AudioSubsystem

source

pub fn spec(&self) -> &AudioSpec

source

pub fn status(&self) -> AudioStatus

source

pub fn pause(&self)

Pauses playback of the audio device.

source

pub fn resume(&self)

Starts playback of the audio device.

source

pub fn queue(&self, data: &[Channel]) -> bool

Adds data to the audio queue.

source

pub fn size(&self) -> u32

source

pub fn clear(&self)

Clears all data from the current audio queue.

Auto Trait Implementations§

§

impl<Channel> Freeze for AudioQueue<Channel>

§

impl<Channel> RefUnwindSafe for AudioQueue<Channel>
where Channel: RefUnwindSafe,

§

impl<Channel> !Send for AudioQueue<Channel>

§

impl<Channel> !Sync for AudioQueue<Channel>

§

impl<Channel> Unpin for AudioQueue<Channel>
where Channel: Unpin,

§

impl<Channel> UnwindSafe for AudioQueue<Channel>
where Channel: UnwindSafe,

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.