Struct ggez::audio::Source [−][src]
pub struct Source { /* fields omitted */ }
A source of audio data connected to a particular Channel
.
Will stop playing when dropped.
Methods
impl Source
[src]
impl Source
pub fn new<P: AsRef<Path>>(context: &mut Context, path: P) -> GameResult<Self>
[src]
pub fn new<P: AsRef<Path>>(context: &mut Context, path: P) -> GameResult<Self>
Create a new Source from the given file.
pub fn from_data(context: &mut Context, data: SoundData) -> GameResult<Self>
[src]
pub fn from_data(context: &mut Context, data: SoundData) -> GameResult<Self>
Creates a new Source using the given SoundData object.
pub fn play(&self) -> GameResult<()>
[src]
pub fn play(&self) -> GameResult<()>
Plays the Source.
pub fn set_repeat(&mut self, repeat: bool)
[src]
pub fn set_repeat(&mut self, repeat: bool)
Sets the source to repeat playback infinitely on next play()
pub fn repeat(&self) -> bool
[src]
pub fn repeat(&self) -> bool
Gets whether or not the source is set to repeat.
pub fn pause(&self)
[src]
pub fn pause(&self)
Pauses playback
pub fn resume(&self)
[src]
pub fn resume(&self)
Resumes playback
pub fn stop(&self)
[src]
pub fn stop(&self)
Stops playback
pub fn stopped(&self) -> bool
[src]
pub fn stopped(&self) -> bool
Returns whether or not the source is stopped -- that is, has no more data to play.
pub fn volume(&self) -> f32
[src]
pub fn volume(&self) -> f32
Gets the current volume
pub fn set_volume(&mut self, value: f32)
[src]
pub fn set_volume(&mut self, value: f32)
Sets the current volume
pub fn paused(&self) -> bool
[src]
pub fn paused(&self) -> bool
Get whether or not the source is paused
pub fn playing(&self) -> bool
[src]
pub fn playing(&self) -> bool
Get whether or not the source is playing (ie, not paused and not stopped)