|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.openal.SoundGroup
public class SoundGroup
Manages a group of sounds, binding them to OpenAL sources as they are played and freeing up those sources for use by other sounds when the sounds are finished.
| Nested Class Summary | |
|---|---|
protected static class |
SoundGroup.PooledSource
Used to track which sources are in use. |
| Field Summary | |
|---|---|
protected float |
_baseGain
The base gain, or -1 to inherit from the manager. |
protected SoundManager |
_manager
|
protected ClipProvider |
_provider
|
protected ArrayList<SoundGroup.PooledSource> |
_sources
|
| Constructor Summary | |
|---|---|
protected |
SoundGroup(SoundManager manager,
ClipProvider provider,
int sources)
|
| Method Summary | |
|---|---|
protected Source |
acquireSource(Sound acquirer)
Called by a Sound when it wants to obtain a source on which to play its clip. |
protected void |
baseGainChanged()
Called by the manager when the base gain has changed. |
void |
dispose()
Disposes this sound group, freeing up the OpenAL sources with which it is associated. |
float |
getBaseGain()
Returns the base gain for this group, or -1 if inherited from the manager. |
protected float |
getInheritedBaseGain()
Used to pass the base gain through to sound effects. |
Sound |
getSound(String path)
Obtains an "instance" of the specified sound which can be positioned, played, looped and otherwise used to make noise. |
void |
preloadClip(String path)
Queues up the specified sound clip for pre-loading into the cache. |
void |
reclaimAll()
Stops and reclaims all sounds from this sound group but does not free the sources. |
void |
setBaseGain(float gain)
Sets the base gain for this group, or -1 to inherit from the manager (the default). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected SoundManager _manager
protected ClipProvider _provider
protected ArrayList<SoundGroup.PooledSource> _sources
protected float _baseGain
| Constructor Detail |
|---|
protected SoundGroup(SoundManager manager,
ClipProvider provider,
int sources)
| Method Detail |
|---|
public void setBaseGain(float gain)
public float getBaseGain()
public void preloadClip(String path)
public Sound getSound(String path)
public void dispose()
public void reclaimAll()
protected Source acquireSource(Sound acquirer)
Sound when it wants to obtain a source on which to play its clip.
protected float getInheritedBaseGain()
protected void baseGainChanged()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||