From f546aad7f4c2a3f3d13fb4855b8519ccb33bcb98 Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Thu, 16 Jul 2020 14:23:57 -0700 Subject: [PATCH] audio: rename `play` to `play_source` and `queue` to `play` --- crates/bevy_audio/src/audio_output.rs | 6 +++--- examples/audio/audio.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/bevy_audio/src/audio_output.rs b/crates/bevy_audio/src/audio_output.rs index aeb5e0450e..a97f5cc09a 100644 --- a/crates/bevy_audio/src/audio_output.rs +++ b/crates/bevy_audio/src/audio_output.rs @@ -19,13 +19,13 @@ impl Default for AudioOutput { } impl AudioOutput { - pub fn play(&self, audio_source: &AudioSource) { + pub fn play_source(&self, audio_source: &AudioSource) { let sink = Sink::new(&self.device); sink.append(Decoder::new(Cursor::new(audio_source.clone())).unwrap()); sink.detach(); } - pub fn queue(&self, audio_source: Handle) { + pub fn play(&self, audio_source: Handle) { self.queue.write().unwrap().push_front(audio_source); } @@ -36,7 +36,7 @@ impl AudioOutput { while i < len { let audio_source_handle = queue.pop_back().unwrap(); if let Some(audio_source) = audio_sources.get(&audio_source_handle) { - self.play(audio_source); + self.play_source(audio_source); } else { // audio source hasn't loaded yet. add it back to the queue queue.push_front(audio_source_handle); diff --git a/examples/audio/audio.rs b/examples/audio/audio.rs index e9bbb80f2b..022767744e 100644 --- a/examples/audio/audio.rs +++ b/examples/audio/audio.rs @@ -11,5 +11,5 @@ fn setup(asset_server: Res, audio_output: Res) { let music = asset_server .load("assets/sounds/Windless Slopes.mp3") .unwrap(); - audio_output.queue(music); + audio_output.play(music); }