|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.newdawn.slick.openal.SoundStore
public class SoundStore
Responsible for holding and playing the sounds used in the game.
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 |
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.io.InputStream in)
Get the Sound based on a specified OGG file |
Audio |
getOgg(java.lang.String ref)
Get the Sound based on a specified OGG file |
Audio |
getOgg(java.lang.String ref,
java.io.InputStream in)
Get the Sound based on a specified OGG 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.io.InputStream 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 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void clear()
public void disable()
public void setDeferredLoading(boolean deferred)
deferred
- True if the we should load a tokenpublic boolean isDeferredLoading()
public void setMusicOn(boolean music)
music
- True if music should be playedpublic boolean isMusicOn()
public void setMusicVolume(float volume)
volume
- The volume for musicpublic float getCurrentMusicVolume()
public void setCurrentMusicVolume(float volume)
volume
- The volume for the current playing musicpublic void setSoundVolume(float volume)
volume
- The volume for sound fxpublic boolean soundWorks()
public boolean musicOn()
public float getSoundVolume()
public float getMusicVolume()
public int getSource(int index)
index
- The ID of a given source
public void setSoundsOn(boolean sounds)
sounds
- True if sound effects should be playedpublic boolean soundsOn()
public void setMaxSources(int max)
max
- The maximum number of sound effects/music to mixpublic void init()
public void setMusicPitch(float pitch)
pitch
- The pitch at which the current music is being playedpublic void pauseLoop()
public void restartLoop()
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 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 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.io.InputStream 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 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 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 getOgg(java.io.InputStream in) throws java.io.IOException
in
- The stream to the OGG to load
java.io.IOException
- Indicates a failure to load the OGGpublic Audio getOgg(java.lang.String ref, java.io.InputStream in) 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 void poll(int delta)
delta
- The amount of time passed since last poll (in milliseconds)public boolean isMusicPlaying()
public static SoundStore get()
public void stopSoundEffect(int id)
id
- The ID of the underlying OpenAL source as returned from playAsSoundEffectpublic int getSourceCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |