de.lessvoid.nifty.sound
Class SoundSystem

java.lang.Object
  extended by de.lessvoid.nifty.sound.SoundSystem

public class SoundSystem
extends Object

The SoundManager loads and manages all available Sound and Music Files available to be played.

Author:
void

Constructor Summary
SoundSystem(SoundDevice newSoundLoader)
          create new sound manager.
 
Method Summary
 boolean addMusic(String name, String filename)
          Add a music file.
 boolean addSound(String name, String filename)
          Add a sound file.
 SoundHandle getMusic(String name)
           
 float getMusicVolume()
          Get music volume.
 SoundHandle getSound(String name)
           
 float getSoundVolume()
          Get current set sound volume.
 void setMusicVolume(float newMusicVolume)
          Set music volume.
 void setSoundVolume(float newSoundVolume)
          Set sound volume.
 void update(int delta)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoundSystem

public SoundSystem(SoundDevice newSoundLoader)
create new sound manager.

Parameters:
newSoundLoader - the SoundLoader we should use
Method Detail

addSound

public boolean addSound(String name,
                        String filename)
Add a sound file.

Parameters:
name - name to register sound for
filename - name of the sound file to load
Returns:
true on success and false when loading the sound failed

addMusic

public boolean addMusic(String name,
                        String filename)
Add a music file.

Parameters:
name - name to register the music for
filename - name of music file
Returns:
true on success and false when loading the music file failed

getSound

public SoundHandle getSound(String name)

getMusic

public SoundHandle getMusic(String name)

getSoundVolume

public float getSoundVolume()
Get current set sound volume.

Returns:
the current sound volume.

setSoundVolume

public void setSoundVolume(float newSoundVolume)
Set sound volume.

Parameters:
newSoundVolume - new sound volume

getMusicVolume

public float getMusicVolume()
Get music volume.

Returns:
current music volume [0.0, 1.0]

setMusicVolume

public void setMusicVolume(float newMusicVolume)
Set music volume.

Parameters:
newMusicVolume - new music volume [0.0, 1.0]

update

public void update(int delta)


Copyright © 2012. All Rights Reserved.