Struct ez_audio::AudioLoader[][src]

pub struct AudioLoader<'a, T, I, P> { /* fields omitted */ }

A builder that loads an audio file into memory and returns an audio playback handle.

Implementations

impl<'a, P> AudioLoader<'a, (), Void, P> where
    P: AsRef<Path>, 
[src]

pub fn new(path: P, context: Context) -> AudioLoader<'a, (), Void, P>[src]

Creates a new default audio loader.

impl<'a, T, I, P> AudioLoader<'a, T, I, P> where
    P: AsRef<Path>,
    I: 'static + FnMut(&mut T) + Send
[src]

pub fn context(self, context: Context) -> Self[src]

Set context.

pub fn device(self, device: &'a Device) -> Self[src]

Set playback device

pub fn volume(self, volume: f32) -> Self[src]

Set playback volume

pub fn load(self) -> Result<AudioHandle<T>, AudioError>[src]

Destroys loader and returns a audio handle

impl<'a, T, I, P0> AudioLoader<'a, T, I, P0>[src]

pub fn path<P1: AsRef<Path>>(self, path: P1) -> AudioLoader<'a, T, I, P1>[src]

Set path to file.

impl<'a, T0, I, P> AudioLoader<'a, T0, I, P>[src]

pub fn user_data<T1>(self, user_data: T1) -> AudioLoader<'a, T1, I, P>[src]

Sets custom userdata

impl<'a, T, F0: Fn(T), P> AudioLoader<'a, T, F0, P>[src]

pub fn on_end<F1: FnMut(&mut T) + Send>(
    self,
    on_end: F1
) -> AudioLoader<'a, T, F1, P>
[src]

Sets closure to be run when the audio handle reaches the end.

Auto Trait Implementations

impl<'a, T, I, P> RefUnwindSafe for AudioLoader<'a, T, I, P> where
    I: RefUnwindSafe,
    P: RefUnwindSafe,
    T: RefUnwindSafe

impl<'a, T, I, P> Send for AudioLoader<'a, T, I, P> where
    I: Send,
    P: Send,
    T: Send

impl<'a, T, I, P> Sync for AudioLoader<'a, T, I, P> where
    I: Sync,
    P: Sync,
    T: Sync

impl<'a, T, I, P> Unpin for AudioLoader<'a, T, I, P> where
    I: Unpin,
    P: Unpin,
    T: Unpin

impl<'a, T, I, P> UnwindSafe for AudioLoader<'a, T, I, P> where
    I: UnwindSafe,
    P: UnwindSafe,
    T: UnwindSafe

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.