public class CommandThread extends SimpleThread
CommandObject. The Command Queue is
located in the SoundSystem class.
Calling kill() stops the thread, and this should be immediatly followed
by a call to interrupt() to wake up the thread so it may end. This class
also checks for temporary sources that are finished playing, and removes
them.
NOTE: The command thread is created automatically by the sound system, so it
is unlikely that the user would ever need to use this class.
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
protected String |
className
Name of this class.
|
protected SoundSystemLogger |
logger
Processes status messages, warnings, and error messages.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
CommandThread(SoundSystem s)
Constructor: Takes a handle to the SoundSystem object as a parameter.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanup()
Shuts the thread down and removes references to all instantiated objects.
|
protected boolean |
errorCheck(boolean error,
String message)
Prints the specified message if error is true.
|
protected void |
errorMessage(String message,
int indent)
Prints an error message.
|
protected void |
importantMessage(String message,
int indent)
Prints an important message.
|
protected void |
message(String message,
int indent)
Prints a message.
|
void |
run()
The main loop for processing commands.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprotected SoundSystemLogger logger
protected String className
public CommandThread(SoundSystem s)
s - Handle to the SoundSystem.protected void cleanup()
cleanup in class SimpleThreadpublic void run()
run in interface Runnablerun in class SimpleThreadprotected void message(String message, int indent)
message - Message to print.protected void importantMessage(String message, int indent)
message - Message to print.protected boolean errorCheck(boolean error,
String message)
error - True or False.message - Message to print if error is true.protected void errorMessage(String message, int indent)
message - Message to print.Copyright © 2017. All rights reserved.