提交 f2cb9637 编写于 作者: V Viktor Lidholt

Rename SoundCompleteCallback to SoundEffectStreamCallback

上级 523bea09
......@@ -3,7 +3,7 @@ part of sprites;
// 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
typedef void SoundCompleteCallback();
typedef void SoundEffectStreamCallback(SoundEffectStream);
class SoundEffect {
SoundEffect(this._url);
......@@ -26,7 +26,7 @@ class SoundEffectStream {
this.volume,
this.pitch,
this.pan,
this.callback
this.onSoundComplete
);
// TODO: Make these properties work
......@@ -40,20 +40,20 @@ class SoundEffectStream {
// TODO: Implement completion callback. On completion, sounds should
// also be removed from the list of playing sounds.
SoundCompleteCallback callback;
SoundEffectStreamCallback onSoundComplete;
MediaPlayerProxy _player;
}
SoundEffectPlayer _sharedSoundPool;
SoundEffectPlayer _sharedSoundEffectPlayer;
class SoundEffectPlayer {
static SoundEffectPlayer sharedInstance() {
if (_sharedSoundPool == null) {
_sharedSoundPool = new SoundEffectPlayer();
if (_sharedSoundEffectPlayer == null) {
_sharedSoundEffectPlayer = new SoundEffectPlayer();
}
return _sharedSoundPool;
return _sharedSoundEffectPlayer;
}
SoundEffectPlayer() {
......@@ -92,7 +92,7 @@ class SoundEffectPlayer {
double volume = 1.0,
double pitch = 1.0,
double pan = 0.0,
SoundCompleteCallback callback = null]) {
SoundEffectStreamCallback callback = null]) {
// Create new PlayingSound object
SoundEffectStream playingSound = new SoundEffectStream(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册