diff --git a/src/java/com/threerings/openal/ClipBuffer.java b/src/java/com/threerings/openal/ClipBuffer.java index f78cebe7..13d117d8 100644 --- a/src/java/com/threerings/openal/ClipBuffer.java +++ b/src/java/com/threerings/openal/ClipBuffer.java @@ -53,7 +53,7 @@ public class ClipBuffer public static Comparable makeKey (ClipProvider provider, String path) { // we'll just use a string, amazing! - return provider + path; + return provider + ":" + path; } /** diff --git a/src/java/com/threerings/openal/SoundManager.java b/src/java/com/threerings/openal/SoundManager.java index d7841264..e9625fe1 100644 --- a/src/java/com/threerings/openal/SoundManager.java +++ b/src/java/com/threerings/openal/SoundManager.java @@ -34,37 +34,31 @@ import com.samskivert.util.Queue; import com.samskivert.util.RunQueue; /** - * An interface to the OpenAL library that provides a number of additional - * services: + * An interface to the OpenAL library that provides a number of additional services: * *
Note: the sound manager is not thread safe (other than - * during its interactions with its internal background loading - * thread). It assumes that all sound loading and play requests will be - * made from a single thread. + *
Note: the sound manager is not thread safe (other than during its interactions with
+ * its internal background loading thread). It assumes that all sound loading and play requests
+ * will be made from a single thread.
*/
public class SoundManager
{
/**
- * Creates, initializes and returns the singleton sound manager
- * instance.
+ * Creates, initializes and returns the singleton sound manager instance.
*
- * @param rqueue a queue that the sound manager can use to post short
- * runnables that must be executed on the same thread from which all
- * other sound methods will be called.
+ * @param rqueue a queue that the sound manager can use to post short runnables that must be
+ * executed on the same thread from which all other sound methods will be called.
*/
public static SoundManager createSoundManager (RunQueue rqueue)
{
if (_soundmgr != null) {
- throw new IllegalStateException(
- "A sound manager has already been created.");
+ throw new IllegalStateException("A sound manager has already been created.");
}
_soundmgr = new SoundManager(rqueue);
return _soundmgr;
@@ -79,9 +73,8 @@ public class SoundManager
}
/**
- * Configures the size of our sound cache. If this value is larger
- * than memory available to the underlying sound system, it will be
- * reduced when OpenAL first tells us we're out of memory.
+ * Configures the size of our sound cache. If this value is larger than memory available to the
+ * underlying sound system, it will be reduced when OpenAL first tells us we're out of memory.
*/
public void setCacheSize (int bytes)
{
@@ -89,9 +82,8 @@ public class SoundManager
}
/**
- * Configures the base gain (which must be a value between 0 and 1.0) which
- * is multiplied to the individual gain assigned to sound effects (but not
- * music).
+ * Configures the base gain (which must be a value between 0 and 1.0) which is multiplied to
+ * the individual gain assigned to sound effects (but not music).
*/
public void setBaseGain (float gain)
{
@@ -107,15 +99,13 @@ public class SoundManager
}
/**
- * Creates an object that can be used to manage and play a group of
- * sounds. Note: the sound group must be disposed
- * when it is no longer needed via a call to {@link
+ * Creates an object that can be used to manage and play a group of sounds. Note: the
+ * sound group must be disposed when it is no longer needed via a call to {@link
* SoundGroup#dispose}.
*
- * @param provider indicates from where the sound group will load its
- * sounds.
- * @param sources indicates the maximum number of simultaneous sounds
- * that can play in this group.
+ * @param provider indicates from where the sound group will load its sounds.
+ * @param sources indicates the maximum number of simultaneous sounds that can play in this
+ * group.
*/
public SoundGroup createGroup (ClipProvider provider, int sources)
{
@@ -131,15 +121,15 @@ public class SoundManager
}
/**
- * Updates all of the streams controlled by the manager. This should be
- * called once per frame by the application.
+ * Updates all of the streams controlled by the manager. This should be called once per frame
+ * by the application.
*
* @param time the number of seconds elapsed since the last update
*/
public void updateStreams (float time)
{
- // iterate backwards through the list so that streams can dispose of
- // themselves during their update
+ // iterate backwards through the list so that streams can dispose of themselves during
+ // their update
for (int ii = _streams.size() - 1; ii >= 0; ii--) {
_streams.get(ii).update(time);
}
@@ -164,15 +154,13 @@ public class SoundManager
int errno = AL10.alGetError();
if (errno != AL10.AL_NO_ERROR) {
- Log.warning("Failed to initialize sound system " +
- "[errno=" + errno + "].");
+ Log.warning("Failed to initialize sound system [errno=" + errno + "].");
// don't start the background loading thread
return;
}
// configure our LRU map with a removal observer
- _clips.setRemovalObserver(
- new LRUHashMap.RemovalObserver