|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.sound.SoundLoader
public class SoundLoader
Loads sound clips specified by package-based properties files.
| Field Summary | |
|---|---|
protected LRUHashMap<String,Config> |
_configs
A cache of config objects we've created. |
protected String |
_defaultClipBundle
The path of the default sound to use for missing sounds. |
protected String |
_defaultClipPath
The path of the default sound to use for missing sounds. |
protected ResourceManager |
_rmgr
|
| Constructor Summary | |
|---|---|
SoundLoader(ResourceManager rmgr,
String defaultBundle,
String defaultPath)
|
|
| Method Summary | |
|---|---|
String |
getBundle(String packagePath)
Returns the bundle for sounds in the given package. |
protected Config |
getConfig(String packagePath)
Get the cached Config. |
String[] |
getPaths(String packagePath,
String key)
Returns the paths to sounds for key in the given package. |
InputStream |
getSound(String bundle,
String path)
Attempts to load a sound stream from the given path from the given bundle and from the classpath. |
byte[][] |
load(String packagePath,
String key)
Loads the sounds for key from the config in <packagePath>/sound.properties |
protected byte[] |
loadClipData(String bundle,
String path)
Read the data from the resource manager. |
void |
shutdown()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ResourceManager _rmgr
protected String _defaultClipBundle
protected String _defaultClipPath
protected LRUHashMap<String,Config> _configs
| Constructor Detail |
|---|
public SoundLoader(ResourceManager rmgr,
String defaultBundle,
String defaultPath)
| Method Detail |
|---|
public byte[][] load(String packagePath,
String key)
throws IOException
<packagePath>/sound.properties
IOException
public String[] getPaths(String packagePath,
String key)
key in the given package. Returns null if no
sounds are found.
public String getBundle(String packagePath)
public InputStream getSound(String bundle,
String path)
throws IOException
IOExceptionpublic void shutdown()
protected Config getConfig(String packagePath)
protected byte[] loadClipData(String bundle,
String path)
throws IOException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||