Class Processor

  • All Implemented Interfaces:
    java.lang.Runnable

    public class Processor
    extends java.lang.Object
    implements java.lang.Runnable
    A thread that plays a music file over and over until terminated.
    • Constructor Summary

      Constructors 
      Constructor Description
      Processor​(@NotNull java.lang.String name, @NotNull AudioFileLoader audioFileLoader)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void run()  
      void terminate​(boolean fadeOut)
      Stops playing music.
      • Methods inherited from class java.lang.Object

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

      • Processor

        public Processor​(@NotNull
                         @NotNull java.lang.String name,
                         @NotNull
                         @NotNull AudioFileLoader audioFileLoader)
        Creates a new instance.
        Parameters:
        name - the music name to play
        audioFileLoader - the audio file loader for loading audio files
    • Method Detail

      • terminate

        public void terminate​(boolean fadeOut)
        Stops playing music. The music is faded out rather than cut off.
        Parameters:
        fadeOut - Whether tp fade out the music (true) or to cut it off (false).
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable