Interface SoundContext


  • public interface SoundContext
    Interface to be implemented by the surrounding application to handle platform specific sound fx. Each sound is connected to an integer key which is used to identify the different sound clips. The IDs for the different sound clips might be reused, but it is guaranteed, that stopClip() is called before the same ID is used for another call of play- or loopClip().
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean isClipPlaying​(int key)
      Checks, if a sound clip for this id is still running.
      void loopClip​(int key, java.lang.String clipName)
      Loops a sound clip with the given name.
      void playClip​(int key, java.lang.String clipName)
      Plays a sound clip with the given name.
      void playClip​(java.lang.String clipName)
      Plays a sound clip with the given name.
      void stopClip​(int key)
      Stops a sound clip with the given id.
    • Method Detail

      • playClip

        void playClip​(java.lang.String clipName)
        Plays a sound clip with the given name. No further action will be necessary after clip is played, StarpointController has no need to stop it.
        Parameters:
        clipName - The name of the audio clip file.
      • playClip

        void playClip​(int key,
                      java.lang.String clipName)
        Plays a sound clip with the given name. Should be stoppable by the stopClip-method.
        Parameters:
        key - The integer key for the sound.
        clipName - The name of the audio clip file.
      • loopClip

        void loopClip​(int key,
                      java.lang.String clipName)
        Loops a sound clip with the given name. Should be stoppable by the stopClip-method.
        Parameters:
        key - The integer key for the sound.
        clipName - The name of the audio clip file.
      • stopClip

        void stopClip​(int key)
        Stops a sound clip with the given id.
        Parameters:
        key - The integer key for the sound.
      • isClipPlaying

        boolean isClipPlaying​(int key)
        Checks, if a sound clip for this id is still running.
        Parameters:
        key - The integer key for the sound.
        Returns:
        true, if the clip is still running.