Class ClipManager
java.lang.Object
com.realtime.crossfire.jxclient.sound.ClipManager
Manages a set of sound clips (short sound effects). Multiple sound effects
can be played simultaneously.
-
Constructor Summary
ConstructorsConstructorDescriptionClipManager(@NotNull AudioFileLoader audioFileLoader, @Nullable DebugWriter debugSound, @NotNull SoundTaskExecutor soundTaskExecutor) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidplay(@NotNull CharSequence action) Plays the given sound effect.voidshutdown()Terminates all running clips and free resources.
-
Constructor Details
-
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 Details
-
play
Plays the given sound effect. This function returns immediately.- Parameters:
action- the action name of the sound effect
-
shutdown
Terminates all running clips and free resources.- Throws:
InterruptedException- if the current thread was interrupted while waiting for the shutdown
-