Class ClipManager

java.lang.Object
com.realtime.crossfire.jxclient.sound.ClipManager

public class ClipManager extends Object
Manages a set of sound clips (short sound effects). Multiple sound effects can be played simultaneously.
  • 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 files
      debugSound - the writer for logging sound related information or null to not log
      soundTaskExecutor - the global sound task executor
  • Method Details

    • play

      public void play(@NotNull @NotNull CharSequence action)
      Plays the given sound effect. This function returns immediately.
      Parameters:
      action - the action name of the sound effect
    • shutdown

      public void shutdown() throws InterruptedException
      Terminates all running clips and free resources.
      Throws:
      InterruptedException - if the current thread was interrupted while waiting for the shutdown