[−][src]Struct ggez::audio::SourceState
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
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]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Same for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
unsafe fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> 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>,
T: Parameter<Self>,
Sets value
as a parameter of self
.