efficom.runningjoe.services
Class SoundManager

java.lang.Object
  extended by efficom.runningjoe.services.SoundManager
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable, LRUCache.CacheEntryRemovedListener<RunningJoeSound,com.badlogic.gdx.audio.Sound>

public class SoundManager
extends java.lang.Object
implements LRUCache.CacheEntryRemovedListener<RunningJoeSound,com.badlogic.gdx.audio.Sound>, com.badlogic.gdx.utils.Disposable

A service that manages the sound effects.


Method Summary
 void dispose()
          Disposes the sound manager.
static SoundManager getInstance()
           
 void notifyEntryRemoved(RunningJoeSound key, com.badlogic.gdx.audio.Sound value)
           
 void play(RunningJoeSound sound)
          Plays the specified sound.
 void setEnabled(boolean enabled)
          Enables or disabled the sound.
 void setVolume(float volume)
          Sets the sound volume which must be inside the range [0,1].
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final SoundManager getInstance()

play

public void play(RunningJoeSound sound)
Plays the specified sound.


setVolume

public void setVolume(float volume)
Sets the sound volume which must be inside the range [0,1].


setEnabled

public void setEnabled(boolean enabled)
Enables or disabled the sound.


notifyEntryRemoved

public void notifyEntryRemoved(RunningJoeSound key,
                               com.badlogic.gdx.audio.Sound value)
Specified by:
notifyEntryRemoved in interface LRUCache.CacheEntryRemovedListener<RunningJoeSound,com.badlogic.gdx.audio.Sound>

dispose

public void dispose()
Disposes the sound manager.

Specified by:
dispose in interface com.badlogic.gdx.utils.Disposable