|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--JavaTron.AudioTron | +--JavaTron.AudioTronState
AudioTron stateful interface class. This class maintains state by updating at periodic intervals. It uses a priority queue to all commands to supercede an update requests. If a command is sent during an update, the update is canceled and requeued.
To get useful information about the state of the AudioTron, register an AudioTronListener with this object. The AudioTronListener will then get notifications wrt to state changes.
Nested Class Summary |
Nested classes inherited from class JavaTron.AudioTron |
AudioTron.InputStreamListener |
Field Summary | |
protected java.lang.reflect.Method |
mParseSongQueue
|
protected java.lang.reflect.Method |
mParseStatus
|
Fields inherited from class JavaTron.AudioTron |
OFF, ON, TOGGLE |
Constructor Summary | |
AudioTronState()
Zero parameter version of constructor -- default settings for address, username, and password. |
|
AudioTronState(java.lang.String server_)
One parameter version of constructor -- allows setting of AudioTron address (default username and password) |
|
AudioTronState(java.lang.String server_,
java.lang.String username_)
Two parameter version of constructor -- allows setting of AudioTron address and username (default password). |
|
AudioTronState(java.lang.String server_,
java.lang.String username_,
java.lang.String password_)
Three parameter version of constructor -- allows setting of AudioTron address, username, and password. |
Method Summary | |
void |
addAudioTronListener(JavaTron.AudioTronListener listener_)
Add an AudioTronListener to this instance |
protected void |
endCommand()
Call at the end of a a command. |
java.util.Enumeration |
getSongQueue()
|
java.lang.String |
getStatus()
Return a text string describing the status of the AudioTron 'engine' status. |
protected boolean |
parseSongQueue(java.lang.String content)
Parse the returned data from the api "apigetinfo.asp" page. |
protected boolean |
parseStatus(java.lang.String content)
Parse the returned data from the api "apigetstatus.asp" page. |
protected void |
refreshStatus()
Update listener(s) with the current status |
void |
setInputStream(java.io.InputStreamReader isr)
Implements the InputStreamListener interface - FOR INTERNAL USE ONLY. |
protected void |
startCommand()
Call at the beginning a command |
Methods inherited from class JavaTron.AudioTron |
addCommand, doCommand, get, get, get, gotoIndex, mute, mute, next, pause, pause, play, post, prev, random, random, repeat, repeat, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.reflect.Method mParseStatus
protected java.lang.reflect.Method mParseSongQueue
Constructor Detail |
public AudioTronState()
public AudioTronState(java.lang.String server_)
public AudioTronState(java.lang.String server_, java.lang.String username_)
server_
- the AudioTron ip address (defaults to 192.168.0.10)username_
- the username to use when accessing AudioTron pages
(defaults to 'admin')public AudioTronState(java.lang.String server_, java.lang.String username_, java.lang.String password_)
server_
- the AudioTron ip address (defaults to 192.168.0.10)username_
- the username to use when accessing AudioTron pages
(defaults to 'admin')password_
- the password to use when accessing the AudioTron pages
(defaults to 'admin')Method Detail |
public void addAudioTronListener(JavaTron.AudioTronListener listener_)
public java.util.Enumeration getSongQueue()
public java.lang.String getStatus()
protected boolean parseStatus(java.lang.String content)
content
- line-by-line content of the data returned
protected boolean parseSongQueue(java.lang.String content)
content
- line-by-line content of the data returned
protected void startCommand()
AudioTron
startCommand
in class AudioTron
protected void endCommand()
AudioTron
endCommand
in class AudioTron
protected void refreshStatus()
public void setInputStream(java.io.InputStreamReader isr)
setInputStream
in interface AudioTron.InputStreamListener
isr
- the InputStreamReader that is being set
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |