Class ClipManager
- java.lang.Object
-
- com.realtime.crossfire.jxclient.sound.ClipManager
-
public class ClipManager extends java.lang.ObjectManages a set of sound clips (short sound effects). Multiple sound effects can be played simultaneously.
-
-
Constructor Summary
Constructors Constructor Description ClipManager(@NotNull AudioFileLoader audioFileLoader, @Nullable DebugWriter debugSound, @NotNull SoundTaskExecutor soundTaskExecutor)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidplay(@Nullable java.lang.String name, @NotNull java.lang.String action)Plays the given sound effect.voidshutdown()Terminates all running clips and free resources.
-
-
-
Constructor Detail
-
ClipManager
public ClipManager(@NotNull @NotNull AudioFileLoader audioFileLoader, @Nullable @Nullable DebugWriter debugSound, @NotNull @NotNull SoundTaskExecutor soundTaskExecutor)Creates a new instance.- Parameters:
audioFileLoader- the audio file loader for loading audio filesdebugSound- the writer for logging sound related information ornullto not logsoundTaskExecutor- the global sound task executor
-
-
Method Detail
-
play
public void play(@Nullable @Nullable java.lang.String name, @NotNull @NotNull java.lang.String action)Plays the given sound effect. This function returns immediately.- Parameters:
name- an optional prefix for the action nameaction- the action name of the sound effect
-
shutdown
public void shutdown() throws java.lang.InterruptedExceptionTerminates all running clips and free resources.- Throws:
java.lang.InterruptedException- if the current thread was interrupted while waiting for the shutdown
-
-