|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectzombie.openal.SoundStore
public class SoundStore
Responsible for holding and playing the sounds used in the game.
Field Summary | |
---|---|
java.util.Stack<AudioImpl> |
audioStore
|
java.util.Stack<AudioImpl> |
usedAudio
|
Method Summary | |
---|---|
void |
clear()
Clear out the sound store contents |
void |
disable()
Disable use of the Sound Store |
static SoundStore |
get()
get the single instance of this class |
Audio |
getAIF(java.io.InputStream in)
get the Sound based on a specified AIF file |
Audio |
getAIF(java.lang.String ref)
get the Sound based on a specified AIF file |
Audio |
getAIF(java.lang.String ref,
java.io.InputStream in)
get the Sound based on a specified AIF file |
AudioImpl |
getAudio()
|
float |
getCurrentMusicVolume()
get the volume scalar of the music that is currently playing. |
Audio |
getMOD(java.io.InputStream in)
get a MOD sound (mod/xm etc) |
Audio |
getMOD(java.lang.String ref)
get a MOD sound (mod/xm etc) |
Audio |
getMOD(java.lang.String ref,
java.io.InputStream in)
get a MOD sound (mod/xm etc) |
float |
getMusicVolume()
get the volume for music |
Audio |
getOgg(java.lang.String ref)
get the Sound based on a specified OGG file |
Audio |
getOgg(java.lang.String ref,
java.lang.String file)
get the Sound based on a specified OGG file |
Audio |
getOggFile(java.lang.String ref)
|
Audio |
getOggFile(java.lang.String ref,
java.lang.String file)
|
Audio |
getOggStream(java.lang.String ref)
get the Sound based on a specified OGG file |
Audio |
getOggStream(java.net.URL ref)
get the Sound based on a specified OGG file |
float |
getSoundVolume()
get the volume for sounds |
int |
getSource(int index)
get the ID of a given source |
int |
getSourceCount()
Retrieve the number of OpenAL sound sources that have been determined at initialisation. |
Audio |
getWAV(java.io.InputStream in)
get the Sound based on a specified WAV file |
Audio |
getWAV(java.lang.String ref)
get the Sound based on a specified WAV file |
Audio |
getWAV(java.lang.String ref,
java.lang.String in)
get the Sound based on a specified WAV file |
void |
init()
Initialise the sound effects stored. |
boolean |
isDeferredLoading()
Check if we're using deferred loading |
boolean |
isMusicOn()
Check if music should currently be playing |
boolean |
isMusicPlaying()
Check if the music is currently playing |
boolean |
musicOn()
Check if music is currently enabled |
void |
pauseLoop()
Pause the music loop that is currently playing |
void |
poll(int delta)
Poll the streaming system |
void |
restartLoop()
Restart the music loop that is currently paused |
void |
setCurrentMusicVolume(float volume)
Set the music volume of the current playing music. |
void |
setDeferredLoading(boolean deferred)
True if we should only record the request to load in the intention of loading the sound later |
void |
setMaxSources(int max)
Set the maximum number of concurrent sound effects that will be attempted |
void |
setMusicOn(boolean music)
Inidicate whether music should be playing |
void |
setMusicPitch(float pitch)
Set the pitch at which the current music is being played |
void |
setMusicVolume(float volume)
Set the music volume |
void |
setSoundsOn(boolean sounds)
Indicate whether sound effects should be played |
void |
setSoundVolume(float volume)
Set the sound volume |
boolean |
soundsOn()
Check if sound effects are currently enabled |
boolean |
soundWorks()
Check if sound works at all |
void |
stopSoundEffect(int id)
Stop a playing sound identified by the ID returned from playing. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public java.util.Stack<AudioImpl> audioStore
public java.util.Stack<AudioImpl> usedAudio
Method Detail |
---|
public static SoundStore get()
public void clear()
public void disable()
public Audio getAIF(java.lang.String ref) throws java.io.IOException
ref
- The reference to the AIF file in the classpath
java.io.IOException
- Indicates a failure to load the AIFpublic Audio getAIF(java.io.InputStream in) throws java.io.IOException
in
- The stream to the MOD to load
java.io.IOException
- Indicates a failure to load the AIFpublic Audio getAIF(java.lang.String ref, java.io.InputStream in) throws java.io.IOException
ref
- The reference to the AIF file in the classpathin
- The stream to the AIF to load
java.io.IOException
- Indicates a failure to load the AIFpublic AudioImpl getAudio()
public float getCurrentMusicVolume()
public Audio getMOD(java.lang.String ref) throws java.io.IOException
ref
- The refernece to the mod to load
java.io.IOException
- Indicates a failure to read the datapublic Audio getMOD(java.io.InputStream in) throws java.io.IOException
in
- The stream to the MOD to load
java.io.IOException
- Indicates a failure to read the datapublic Audio getMOD(java.lang.String ref, java.io.InputStream in) throws java.io.IOException
ref
- The stream to the MOD to loadin
- The stream to the MOD to load
java.io.IOException
- Indicates a failure to read the datapublic float getMusicVolume()
public Audio getOgg(java.lang.String ref) throws java.io.IOException
ref
- The reference to the OGG file in the classpath
java.io.IOException
- Indicates a failure to load the OGGpublic Audio getOggFile(java.lang.String ref) throws java.io.IOException
java.io.IOException
public Audio getOgg(java.lang.String ref, java.lang.String file) throws java.io.IOException
ref
- The reference to the OGG file in the classpathin
- The stream to the OGG to load
java.io.IOException
- Indicates a failure to load the OGGpublic Audio getOggFile(java.lang.String ref, java.lang.String file) throws java.io.IOException
java.io.IOException
public Audio getOggStream(java.lang.String ref) throws java.io.IOException
ref
- The reference to the OGG file in the classpath
java.io.IOException
- Indicates a failure to load the OGGpublic Audio getOggStream(java.net.URL ref) throws java.io.IOException
ref
- The reference to the OGG file in the classpath
java.io.IOException
- Indicates a failure to load the OGGpublic float getSoundVolume()
public int getSource(int index)
index
- The ID of a given source
public int getSourceCount()
public Audio getWAV(java.lang.String ref) throws java.io.IOException
ref
- The reference to the WAV file in the classpath
java.io.IOException
- Indicates a failure to load the WAVpublic Audio getWAV(java.io.InputStream in) throws java.io.IOException
in
- The stream to the WAV to load
java.io.IOException
- Indicates a failure to load the WAVpublic Audio getWAV(java.lang.String ref, java.lang.String in) throws java.io.IOException
ref
- The reference to the WAV file in the classpathin
- The stream to the WAV to load
java.io.IOException
- Indicates a failure to load the WAVpublic void init()
public boolean isDeferredLoading()
public boolean isMusicOn()
public boolean isMusicPlaying()
public boolean musicOn()
public void pauseLoop()
public void poll(int delta)
delta
- The amount of time passed since last poll (in milliseconds)public void restartLoop()
public void setCurrentMusicVolume(float volume)
volume
- The volume for the current playing musicpublic void setDeferredLoading(boolean deferred)
deferred
- True if the we should load a tokenpublic void setMaxSources(int max)
max
- The maximum number of sound effects/music to mixpublic void setMusicOn(boolean music)
music
- True if music should be playedpublic void setMusicPitch(float pitch)
pitch
- The pitch at which the current music is being playedpublic void setMusicVolume(float volume)
volume
- The volume for musicpublic void setSoundsOn(boolean sounds)
sounds
- True if sound effects should be playedpublic void setSoundVolume(float volume)
volume
- The volume for sound fxpublic boolean soundsOn()
public boolean soundWorks()
public void stopSoundEffect(int id)
id
- The ID of the underlying OpenAL source as returned from playAsSoundEffect
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |