[−][src]Struct ggez::audio::Source
A source of audio data that is connected to an output channel and ready to play. It will stop playing when dropped.
Methods
impl Source
[src]
pub fn new<P: AsRef<Path>>(context: &mut Context, path: P) -> GameResult<Self>
[src]
Create a new Source
from the given file.
pub fn from_data(context: &mut Context, data: SoundData) -> GameResult<Self>
[src]
Creates a new Source
using the given SoundData
object.
Trait Implementations
impl SoundSource for Source
[src]
fn play_later(&self) -> GameResult
[src]
fn play_detached(&mut self) -> GameResult
[src]
fn set_repeat(&mut self, repeat: bool)
[src]
fn set_fade_in(&mut self, dur: Duration)
[src]
fn set_pitch(&mut self, ratio: f32)
[src]
fn repeat(&self) -> bool
[src]
fn pause(&self)
[src]
fn resume(&self)
[src]
fn stop(&mut self)
[src]
fn stopped(&self) -> bool
[src]
fn volume(&self) -> f32
[src]
fn set_volume(&mut self, value: f32)
[src]
fn paused(&self) -> bool
[src]
fn playing(&self) -> bool
[src]
fn elapsed(&self) -> Duration
[src]
fn set_query_interval(&mut self, t: Duration)
[src]
fn play(&mut self) -> GameResult
[src]
Plays the audio source; restarts the sound if currently playing
impl Debug for Source
[src]
Auto Trait Implementations
impl Unpin for Source
impl Sync for Source
impl Send for Source
impl RefUnwindSafe for Source
impl UnwindSafe for Source
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> 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
.