Class SoundController


  • public class SoundController
    extends java.lang.Object
    Controls the SoundPlayer.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.logging.Logger logger  
      private SoundPlayer soundPlayer
      The internal sound player.
    • Constructor Summary

      Constructors 
      Constructor Description
      SoundController​(FreeColClient freeColClient, boolean sound)
      Prepare the sound system.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canPlaySound()
      Can this client play sounds?
      java.lang.String getSoundMixerLabelText()
      Get the label text for the sound player mixer.
      void playSound​(java.lang.String sound)
      Play a sound.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
      • soundPlayer

        private SoundPlayer soundPlayer
        The internal sound player.
    • Constructor Detail

      • SoundController

        public SoundController​(FreeColClient freeColClient,
                               boolean sound)
        Prepare the sound system.
        Parameters:
        freeColClient - The FreeColClient for the game.
        sound - Enable sound if true.
    • Method Detail

      • canPlaySound

        public boolean canPlaySound()
        Can this client play sounds?
        Returns:
        True if there is a sound player with a valid mixer present.
      • playSound

        public void playSound​(java.lang.String sound)
        Play a sound.
        Parameters:
        sound - The sound resource to play, or if null stop playing.
      • getSoundMixerLabelText

        public java.lang.String getSoundMixerLabelText()
        Get the label text for the sound player mixer. Needed by the audio mixer option UI.
        Returns:
        The text.