Class ClipCache
- java.lang.Object
-
- com.realtime.crossfire.jxclient.sound.ClipCache
-
public class ClipCache extends java.lang.ObjectAllocates new sound clips.
-
-
Constructor Summary
Constructors Constructor Description ClipCache(@NotNull AudioFileLoader audioFileLoader, @Nullable DebugWriter debugSound)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable javax.sound.sampled.DataLineallocateClip(@Nullable java.lang.String name, @NotNull java.lang.String action)Allocates a new clip.voidfreeClip(@NotNull javax.sound.sampled.Line clip)Deallocates a clip.
-
-
-
Constructor Detail
-
ClipCache
public ClipCache(@NotNull @NotNull AudioFileLoader audioFileLoader, @Nullable @Nullable DebugWriter debugSound)Creates a new instance.- Parameters:
audioFileLoader- the audio file loader for loading audio filesdebugSound- the writer for logging sound related information ornullto not log
-
-
Method Detail
-
freeClip
public void freeClip(@NotNull @NotNull javax.sound.sampled.Line clip)Deallocates a clip.- Parameters:
clip- the clip to deallocate
-
allocateClip
@Nullable public @Nullable javax.sound.sampled.DataLine allocateClip(@Nullable @Nullable java.lang.String name, @NotNull @NotNull java.lang.String action)Allocates a new clip.- Parameters:
name- an optional prefix for the action nameaction- the action name of the clip to allocate- Returns:
- the new clip, or
nullif an error occurs
-
-