Inheritance diagram for Device:
Public Member Functions | |
Device (String theHostNameOrIPAddr, String descriptiveName) | |
Provide an IP address of a remote device that is listening for actions. | |
void | connect () |
Once we have connected, we can start sending this device commands. | |
void | disconnect () |
ActionChannel | getActionChannel () |
AudioChannel | getAudioChannel () |
The audio channel provides convenience functions to easily play audio or read text on this device. | |
DisplayChannel | getDisplayChannel () |
Access the display. | |
String | getName () |
void | invokeAction (R3Action action) |
Send actions directly to the REMOTE device that this Device object represents. | |
boolean | isAlive () |
Instead of pinging, we check if a device is "reachable" by making sure it has a host address. | |
Static Public Member Functions | |
static PlaySoundAction | doPlaySound (File soundFile) |
Plays the sound file on the local device. | |
static void | doSpeakText (String textToSpeak) |
static void | doOpenURL (String urlString) |
Opens a URL on the local machine. | |
static OpenFileAction | doOpenFile (File file) |
Opens a file on the local device, using the default file editor. |
Devices work closely with the Actions API. Basically, devices are constructs that allow us to send events and actions to remote machines...
This software is distributed under the BSD License.
Definition at line 39 of file Device.java.
void connect | ( | ) |
Once we have connected, we can start sending this device commands.
...
Definition at line 136 of file Device.java.
static OpenFileAction doOpenFile | ( | File | file | ) | [static] |
Opens a file on the local device, using the default file editor.
file |
Definition at line 248 of file Device.java.
References OpenFileAction.invoke().
static PlaySoundAction doPlaySound | ( | File | soundFile | ) | [static] |
Plays the sound file on the local device.
soundFile |
Definition at line 86 of file Device.java.
References PlaySoundAction.invoke(), and PlaySoundAction.stop().
static void doSpeakText | ( | String | textToSpeak | ) | [static] |
ActionChannel getActionChannel | ( | ) |
AudioChannel getAudioChannel | ( | ) |
The audio channel provides convenience functions to easily play audio or read text on this device.
But, if you need to access the sender directly, you can always call the lower level invokeAction(...).
Definition at line 166 of file Device.java.
DisplayChannel getDisplayChannel | ( | ) |
String getName | ( | ) |
void invokeAction | ( | R3Action | action | ) |
Send actions directly to the REMOTE device that this Device object represents.
action |
Definition at line 197 of file Device.java.
References ActionSender.invokeRemoteAction().
Referenced by ActionChannel.openFile(), ActionChannel.openURL(), AudioChannel.playSoundFile(), AudioChannel.readTextOutLoud(), and ActionChannel.typeString().
boolean isAlive | ( | ) |
Instead of pinging, we check if a device is "reachable" by making sure it has a host address.
Definition at line 210 of file Device.java.