java.lang.Object com.realtime.crossfire.jxclient.sound.ClipCache
public class ClipCache
Allocates new sound clips.
Field Summary | |
---|---|
private AudioFileLoader |
audioFileLoader
The AudioFileLoader for loading audio files. |
private DebugWriter |
debugSound
The writer for logging sound related information or null to
not log. |
Constructor Summary | |
---|---|
ClipCache(AudioFileLoader audioFileLoader,
DebugWriter debugSound)
Creates a new instance. |
Method Summary | |
---|---|
javax.sound.sampled.DataLine |
allocateClip(java.lang.String name,
java.lang.String action)
Allocates a new clip. |
void |
freeClip(javax.sound.sampled.Line clip)
Deallocates a clip. |
private javax.sound.sampled.DataLine |
newClip(java.lang.String name,
java.lang.String action)
Allocates a new clip. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@NotNull private final AudioFileLoader audioFileLoader
AudioFileLoader
for loading audio files.
@Nullable private final DebugWriter debugSound
null
to
not log.
Constructor Detail |
---|
public ClipCache(@NotNull AudioFileLoader audioFileLoader, @Nullable DebugWriter debugSound)
audioFileLoader
- the audio file loader for loading audio filesdebugSound
- the writer for logging sound related information or
null
to not logMethod Detail |
---|
@Nullable public javax.sound.sampled.DataLine allocateClip(@Nullable java.lang.String name, @NotNull java.lang.String action)
name
- an optional prefix for the action nameaction
- the action name of the clip to allocate
null
if an error occurspublic void freeClip(@NotNull javax.sound.sampled.Line clip)
clip
- the clip to deallocate@Nullable private javax.sound.sampled.DataLine newClip(@Nullable java.lang.String name, @NotNull java.lang.String action)
name
- an optional prefix for the action nameaction
- the action name of the clip to allocate
null
if an error occurs