Commit 3d31273e authored by Viktor Lidholt's avatar Viktor Lidholt

Rename SoundCompleteCallback to SoundEffectStreamCallback

parent fa82f1a6
...@@ -3,7 +3,7 @@ part of sprites; ...@@ -3,7 +3,7 @@ part of sprites;
// TODO: The sound effects should probably use Android's SoundPool instead of // TODO: The sound effects should probably use Android's SoundPool instead of
// MediaPlayer as it is more efficient and flexible for playing back sound effects // MediaPlayer as it is more efficient and flexible for playing back sound effects
typedef void SoundCompleteCallback(); typedef void SoundEffectStreamCallback(SoundEffectStream);
class SoundEffect { class SoundEffect {
SoundEffect(this._url); SoundEffect(this._url);
...@@ -26,7 +26,7 @@ class SoundEffectStream { ...@@ -26,7 +26,7 @@ class SoundEffectStream {
this.volume, this.volume,
this.pitch, this.pitch,
this.pan, this.pan,
this.callback this.onSoundComplete
); );
// TODO: Make these properties work // TODO: Make these properties work
...@@ -40,20 +40,20 @@ class SoundEffectStream { ...@@ -40,20 +40,20 @@ class SoundEffectStream {
// TODO: Implement completion callback. On completion, sounds should // TODO: Implement completion callback. On completion, sounds should
// also be removed from the list of playing sounds. // also be removed from the list of playing sounds.
SoundCompleteCallback callback; SoundEffectStreamCallback onSoundComplete;
MediaPlayerProxy _player; MediaPlayerProxy _player;
} }
SoundEffectPlayer _sharedSoundPool; SoundEffectPlayer _sharedSoundEffectPlayer;
class SoundEffectPlayer { class SoundEffectPlayer {
static SoundEffectPlayer sharedInstance() { static SoundEffectPlayer sharedInstance() {
if (_sharedSoundPool == null) { if (_sharedSoundEffectPlayer == null) {
_sharedSoundPool = new SoundEffectPlayer(); _sharedSoundEffectPlayer = new SoundEffectPlayer();
} }
return _sharedSoundPool; return _sharedSoundEffectPlayer;
} }
SoundEffectPlayer() { SoundEffectPlayer() {
...@@ -92,7 +92,7 @@ class SoundEffectPlayer { ...@@ -92,7 +92,7 @@ class SoundEffectPlayer {
double volume = 1.0, double volume = 1.0,
double pitch = 1.0, double pitch = 1.0,
double pan = 0.0, double pan = 0.0,
SoundCompleteCallback callback = null]) { SoundEffectStreamCallback callback = null]) {
// Create new PlayingSound object // Create new PlayingSound object
SoundEffectStream playingSound = new SoundEffectStream( SoundEffectStream playingSound = new SoundEffectStream(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment