|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--JavaTron.AudioTron
Implements the AudioTron api. The AudioTron object calls all api command requests on a seperate thread. All calls to the AudioTron object API's are non blocking.
State is notified via a AudioTronListener object. If you want state use an AudioTronState object instead.
Nested Class Summary | |
static interface |
AudioTron.InputStreamListener
|
Field Summary | |
java.lang.Integer |
OFF
|
java.lang.Integer |
ON
|
java.lang.Integer |
TOGGLE
|
Constructor Summary | |
AudioTron()
Zero parameter version of constructor -- default settings for address, username, and password. |
|
AudioTron(java.lang.String server_)
One parameter version of constructor -- allows setting of AudioTron address (default username and password) |
|
AudioTron(java.lang.String server_,
java.lang.String username_)
Two parameter version of constructor -- allows setting of AudioTron address and username (default password). |
|
AudioTron(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 | |
protected void |
addCommand(JavaTron.WrappedMethod wm,
int priority)
Add a command to execute. |
protected void |
doCommand(java.lang.String command,
java.lang.String state)
Perform a command synchronously. |
protected void |
endCommand()
Call at the end of a a command. |
protected java.lang.String |
get(AudioTron.InputStreamListener listener,
java.lang.String address)
Send a get request to the AudioTron server (2 param version). |
protected java.lang.String |
get(AudioTron.InputStreamListener listener,
java.lang.String address,
java.util.Vector args)
Send a get request to the AudioTron server (3 param version). |
protected java.lang.String |
get(AudioTron.InputStreamListener listener,
java.lang.String address,
java.util.Vector args,
java.lang.reflect.Method parser)
Send a get request to the AudioTron server |
void |
gotoIndex(int index)
Tell the AudioTron to go to a new index |
void |
mute()
Tell the AudioTron to toggle the Mute setting |
void |
mute(java.lang.Integer state)
Tell the AudioTron to set the Mute setting |
void |
next()
Tell the AudioTron to go forward (Next) |
void |
pause()
Tell the AudioTron to toggle the Pause setting |
void |
pause(java.lang.Integer state)
Tell the AudioTron to Pause |
void |
play()
Tell the AudioTron to Play |
protected void |
post(java.lang.String formAddress,
java.util.Vector args)
Send a form to the AudioTron server |
void |
prev()
Tell the AudioTron to go back (Prev) |
void |
random()
Tell the AudioTron to toggle the Random setting |
void |
random(java.lang.Integer state)
Tell the AudioTron to set the Random setting |
void |
repeat()
Tell the AudioTron to toggle the Repeat setting |
void |
repeat(java.lang.Integer state)
Tell the AudioTron to set the Repeat setting |
protected void |
startCommand()
Call at the beginning a command |
void |
stop()
Tell the AudioTron to Stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public final java.lang.Integer ON
public final java.lang.Integer OFF
public final java.lang.Integer TOGGLE
Constructor Detail |
public AudioTron()
public AudioTron(java.lang.String server_)
public AudioTron(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 AudioTron(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 stop()
public void play()
public void prev()
public void next()
public void pause()
public void pause(java.lang.Integer state)
state
- the state to set the setting to. Must be one of
ON
, OFF
, TOGGLE
.public void random()
public void random(java.lang.Integer state)
state
- the state to set the setting to. Must be one of
ON
, OFF
, TOGGLE
.public void repeat()
public void repeat(java.lang.Integer state)
state
- the state to set the setting to. Must be one of
ON
, OFF
, TOGGLE
.public void mute()
public void mute(java.lang.Integer state)
state
- the state to set the setting to. Must be one of
ON
, OFF
, TOGGLE
.public void gotoIndex(int index)
index
- the index to go toprotected void doCommand(java.lang.String command, java.lang.String state)
command
- the command to performstate
- additional args.protected void post(java.lang.String formAddress, java.util.Vector args)
protected java.lang.String get(AudioTron.InputStreamListener listener, java.lang.String address)
protected java.lang.String get(AudioTron.InputStreamListener listener, java.lang.String address, java.util.Vector args)
protected java.lang.String get(AudioTron.InputStreamListener listener, java.lang.String address, java.util.Vector args, java.lang.reflect.Method parser)
listener
- if set (can be null) the InputStreamReader that is created
for this connection is notified through this interfaceaddress
- the uri to useargs
- the arguments to useparser
- an optional line-by-line parser to use instead of buffering
the whole response
protected void addCommand(JavaTron.WrappedMethod wm, int priority)
wm
- the callback method to invoke.protected void startCommand()
protected void endCommand()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |