There's no way to genericize the Comparable while using the static
ClipBuffer.makeKey to create them, and non-genericized Comparables make the Baby Jesus(Nate) cry, so just drop the pretense and use String. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@631 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -181,8 +181,8 @@ public class SoundManager
|
||||
}
|
||||
|
||||
// configure our LRU map with a removal observer
|
||||
_clips.setRemovalObserver(new LRUHashMap.RemovalObserver<Comparable,ClipBuffer>() {
|
||||
public void removedFromMap (LRUHashMap<Comparable,ClipBuffer> map,
|
||||
_clips.setRemovalObserver(new LRUHashMap.RemovalObserver<String, ClipBuffer>() {
|
||||
public void removedFromMap (LRUHashMap<String, ClipBuffer> map,
|
||||
final ClipBuffer item) {
|
||||
_rqueue.postRunnable(new Runnable() {
|
||||
public void run () {
|
||||
@@ -218,7 +218,7 @@ public class SoundManager
|
||||
*/
|
||||
protected ClipBuffer getClip (ClipProvider provider, String path, Observer observer)
|
||||
{
|
||||
Comparable ckey = ClipBuffer.makeKey(provider, path);
|
||||
String ckey = ClipBuffer.makeKey(provider, path);
|
||||
ClipBuffer buffer = _clips.get(ckey);
|
||||
try {
|
||||
if (buffer == null) {
|
||||
@@ -301,7 +301,7 @@ public class SoundManager
|
||||
final Clip clip = buffer.load();
|
||||
_rqueue.postRunnable(new Runnable() {
|
||||
public void run () {
|
||||
Comparable ckey = buffer.getKey();
|
||||
String ckey = buffer.getKey();
|
||||
log.debug("Loaded " + ckey + ".");
|
||||
_loading.remove(ckey);
|
||||
if (buffer.bind(clip)) {
|
||||
@@ -330,11 +330,11 @@ public class SoundManager
|
||||
protected float _baseGain = 1;
|
||||
|
||||
/** Contains a mapping of all currently-loading clips. */
|
||||
protected HashMap<Comparable, ClipBuffer> _loading = Maps.newHashMap();
|
||||
protected HashMap<String, ClipBuffer> _loading = Maps.newHashMap();
|
||||
|
||||
/** Contains a mapping of all loaded clips. */
|
||||
protected LRUHashMap<Comparable, ClipBuffer> _clips =
|
||||
new LRUHashMap<Comparable, ClipBuffer>(DEFAULT_CACHE_SIZE, _sizer);
|
||||
protected LRUHashMap<String, ClipBuffer> _clips =
|
||||
new LRUHashMap<String, ClipBuffer>(DEFAULT_CACHE_SIZE, _sizer);
|
||||
|
||||
/** Contains a queue of clip buffers waiting to be loaded. */
|
||||
protected Queue<ClipBuffer> _toLoad;
|
||||
|
||||
Reference in New Issue
Block a user