Fever sound factory manager.
Allow to switch between defined sound factories.
Declared sound factories in configuration file :
<sounds>
<factory id="interface" url="interface.swf" ref="click" manager="true" run="true" />
<factory id="interface2" url="interface2.swf" ref="click" manager="true" />
</sounds>
manager attribute must be set to true to enable factory to
be managed.
run attribute define if factory must be loaded at startup or not. Default use the
first factory added to manager.
then use the manager ( statics method ) to load factory you want
AppSoundFactory.load( "interface2" ); AppSoundFactory.getSoundFactory().getSound( "click" ).start();
Of course, all managed factories must have the sounds references to play nice.
Sounds library runtime switching !
static public function getInstance():AppSoundFactoryReturns unique AppSoundFactory instance.
static public function register(name:String):Boolean
Adds AppSoundFactory factory named name in repository
manager.
After, you can switch factory using load() method.
static public function load(name:String):Void
Sets AppSoundFactory named name as current
sound factory.
static public function play(soundID:String):Void
Shortcut to start passed-in soundID in current factory.
static public function loop(soundID:String):Void
Shortcut to start passed-in soundID in current factory.
Loop mode.
static public function getSoundFactory():AppSoundFactoryReturns current sound factory.
static public function getSoundFactoryList():ArrayReturns registred sound factory id list.
public function getSound(id:String):Sound
Overrides SoundFactory.getSound() method to log an error message
if passed-in id sound not exist in factory.