efficom.runningjoe.services
Class MusicManager

java.lang.Object
  extended by efficom.runningjoe.services.MusicManager
All Implemented Interfaces:
com.badlogic.gdx.utils.Disposable

public class MusicManager
extends java.lang.Object
implements com.badlogic.gdx.utils.Disposable

A service that manages the background music.

Only one music may be playing at a given time.


Nested Class Summary
static class MusicManager.RunningJoeMusic
          The available music files.
 
Method Summary
 void dispose()
          Disposes the music manager.
static MusicManager getInstance()
           
 void play(MusicManager.RunningJoeMusic music)
          Plays the given music (starts the streaming).
 void setEnabled(boolean enabled)
          Enables or disabled the music.
 void setVolume(float volume)
          Sets the music volume which must be inside the range [0,1].
 void stop()
          Stops and disposes the current music being played, if any.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final MusicManager getInstance()

play

public void play(MusicManager.RunningJoeMusic music)
Plays the given music (starts the streaming).

If there is already a music being played it is stopped automatically.


stop

public void stop()
Stops and disposes the current music being played, if any.


setVolume

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


setEnabled

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


dispose

public void dispose()
Disposes the music manager.

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