[][src]Struct ggez::audio::SourceState

pub struct SourceState { /* fields omitted */ }

Internal state used by audio sources.

Methods

impl SourceState[src]

pub fn new(cursor: Cursor<SoundData>) -> Self[src]

Create a new SourceState based around the given SoundData

pub fn set_repeat(&mut self, repeat: bool)[src]

Sets the source to repeat playback infinitely on next play()

pub fn set_fade_in(&mut self, dur: Duration)[src]

Sets the fade-in time of the source.

pub fn set_pitch(&mut self, ratio: f32)[src]

Sets the pitch ratio (by adjusting the playback speed).

pub fn repeat(&self) -> bool[src]

Gets whether or not the source is set to repeat.

pub fn elapsed(&self) -> Duration[src]

Get the time the source has been playing since the last call to play().

Time measurement is based on audio samples consumed, so it may drift from the system clock over longer periods of time.

pub fn set_query_interval(&mut self, t: Duration)[src]

Set the update interval of the internal sample counter.

This parameter determines the precision of the time measured by elapsed().

Trait Implementations

impl Debug for SourceState[src]

Auto Trait Implementations

impl Send for SourceState

impl Sync for SourceState

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Same for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>, 

impl<T> Erased for T

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.