When testing, allow sounds to be cached if they're locked.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1997 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: SoundManager.java,v 1.31 2002/11/26 18:54:39 ray Exp $
|
// $Id: SoundManager.java,v 1.32 2002/11/26 21:14:11 ray Exp $
|
||||||
|
|
||||||
package com.threerings.media;
|
package com.threerings.media;
|
||||||
|
|
||||||
@@ -589,6 +589,11 @@ public class SoundManager
|
|||||||
protected byte[] getClipData (SoundKey key)
|
protected byte[] getClipData (SoundKey key)
|
||||||
throws IOException, UnsupportedAudioFileException
|
throws IOException, UnsupportedAudioFileException
|
||||||
{
|
{
|
||||||
|
// if we're testing, clear all non-locked sounds every time
|
||||||
|
if (_testDir != null) {
|
||||||
|
_clipCache.clear();
|
||||||
|
}
|
||||||
|
|
||||||
byte[][] data = (byte[][]) _clipCache.get(key);
|
byte[][] data = (byte[][]) _clipCache.get(key);
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
|
|
||||||
@@ -615,12 +620,7 @@ public class SoundManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: be more sophisticated and allow locked sounds (as long
|
_clipCache.put(key, data);
|
||||||
// as they're locked) to be put in the cache
|
|
||||||
// for now- nothing is cached when we're testing
|
|
||||||
if (_testDir == null) {
|
|
||||||
_clipCache.put(key, data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return data[RandomUtil.getInt(data.length)];
|
return data[RandomUtil.getInt(data.length)];
|
||||||
|
|||||||
Reference in New Issue
Block a user