Class StreamThread

All Implemented Interfaces:
Runnable

public class StreamThread extends SimpleThread
The StreamThread class is used to process all streaming sources. This thread starts out asleep, and it sleeps when all streaming sources are finished playing, so it is necessary to call interrupt() after adding new streaming sources to the list.

SoundSystem License:

You are free to use this library for any purpose, commercial or otherwise. You may modify this library or source code, and distribute it any way you like, provided the following conditions are met:
1) You may not falsely claim to be the author of this library or any unmodified portion of it.
2) You may not copyright this library or a modified version of it and then sue me for copyright infringement.
3) If you modify the source code, you must clearly document the changes made before redistributing the modified source code, so other users know it is not the original code.
4) You are not required to give me credit for this library in any derived work, but if you do, you must also mention my website: http://www.paulscode.com
5) I the author will not be responsible for any damages (physical, financial, or otherwise) caused by the use if this library or any part of it.
6) I the author do not guarantee, warrant, or make any representations, either expressed or implied, regarding the use of this library or any part of it.

Author: Paul Lamb
http://www.paulscode.com
  • Constructor Details

    • StreamThread

      public StreamThread()
      Constructor: Grabs a handle to the message logger and instantiates the streaming sources list.
  • Method Details

    • cleanup

      protected void cleanup()
      Removes all references to instantiated objects, and changes the thread's state to "not alive". Method alive() returns false when the cleanup() method has completed.
      Overrides:
      cleanup in class SimpleThread
    • run

      public void run()
      The main loop for processing commands. The thread sleeps when it finishes processing commands, and it must be interrupted to process more.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class SimpleThread
    • watch

      public void watch(Source source)
      Adds a new streaming source to the list. If another source in the list is already playing on the same channel, it is stopped and removed from the list.
      Parameters:
      source - New source to stream.