Refactors names of sound effect classes
diff --git a/examples/game/lib/game_demo_world.dart b/examples/game/lib/game_demo_world.dart index cc683e6..6d0e6e5 100644 --- a/examples/game/lib/game_demo_world.dart +++ b/examples/game/lib/game_demo_world.dart
@@ -30,7 +30,7 @@ SpriteSheet _spriteSheetUI; Map<String,SoundEffect> _sounds; - SoundPool _soundPool = SoundPool.sharedInstance(); + SoundEffectPlayer _soundPool = SoundEffectPlayer.sharedInstance(); Navigator _navigator;
diff --git a/examples/game/lib/sound.dart b/examples/game/lib/sound.dart index 73f253a..8079869 100644 --- a/examples/game/lib/sound.dart +++ b/examples/game/lib/sound.dart
@@ -18,8 +18,8 @@ Object _data; } -class SoundStream { - SoundStream( +class SoundEffectStream { + SoundEffectStream( this.sound, this.tag, this.loop, @@ -45,29 +45,29 @@ MediaPlayerProxy _player; } -SoundPool _sharedSoundPool; +SoundEffectPlayer _sharedSoundPool; -class SoundPool { +class SoundEffectPlayer { - static SoundPool sharedInstance() { + static SoundEffectPlayer sharedInstance() { if (_sharedSoundPool == null) { - _sharedSoundPool = new SoundPool(); + _sharedSoundPool = new SoundEffectPlayer(); } return _sharedSoundPool; } - SoundPool() { + SoundEffectPlayer() { _mediaService = new MediaServiceProxy.unbound(); shell.requestService(null, _mediaService); } MediaServiceProxy _mediaService; - List<SoundStream> _playingSounds = []; + List<SoundEffectStream> _playingSounds = []; // TODO: This should no longer be needed when moving to SoundPool backing Map<SoundEffect,MediaPlayerProxy> _mediaPlayers = {}; - Future _prepare(SoundStream playingSound) async { + Future _prepare(SoundEffectStream playingSound) async { await playingSound._player.ptr.prepare(playingSound.sound._data); } @@ -85,7 +85,7 @@ // TODO: Add paused property (should pause playback of all sounds) bool paused; - SoundStream play( + SoundEffectStream play( SoundEffect sound, [Object tag, bool loop = false, @@ -95,7 +95,7 @@ SoundCompleteCallback callback = null]) { // Create new PlayingSound object - SoundStream playingSound = new SoundStream( + SoundEffectStream playingSound = new SoundEffectStream( sound, tag, loop, @@ -131,7 +131,7 @@ void stop(Object tag) { for (int i = _playingSounds.length; i >= 0; i--) { - SoundStream playingSound = _playingSounds[i]; + SoundEffectStream playingSound = _playingSounds[i]; if (playingSound.tag == tag) { playingSound._player.ptr.pause(); _playingSounds.removeAt(i); @@ -139,9 +139,9 @@ } } - List<SoundStream> playingSoundsForTag(Object tag) { - List<SoundStream> list = []; - for (SoundStream playingSound in _playingSounds) { + List<SoundEffectStream> playingSoundsForTag(Object tag) { + List<SoundEffectStream> list = []; + for (SoundEffectStream playingSound in _playingSounds) { if (playingSound.tag == tag) { list.add(playingSound); } @@ -150,7 +150,7 @@ } void stopAll() { - for (SoundStream playingSound in _playingSounds) { + for (SoundEffectStream playingSound in _playingSounds) { playingSound._player.ptr.pause(); } _playingSounds = [];