public interface Controller
Controller
global variable.Modifier and Type | Method and Description |
---|---|
void |
addConnectivityListener(ConnectivityListener listener)
Adds a connectivity listener interface for receiving internet connectivity events.
|
void |
addOnBeaconListener(OnBeaconListener listener)
Adds a beacon listener interface to receive beacon enter/exit events.
|
void |
addOnCommandListener(OnCommandListener listener)
Adds a command listener interface to receive service and user command.
|
void |
addOnImpressionListener(OnImpressionListener listener)
Adds the on impression listener.
|
void |
addOnMotionListener(OnMotionListener listener)
Adds a beacon listener interface to receive motion events.
|
void |
addOnPlayedListener(OnPlayedListener listener)
Adds a played listener interface to receive media played events.
|
void |
addTemplateListener(TemplateListener listener)
Adds a template listener interface to receive template related events.
|
java.lang.String |
converse()
Trigger recording of audio and send result to DialogFlow.
|
Device |
getDevice()
Returns information related to the device currently running the script.
|
java.lang.String |
getDeviceKey()
Returns the unique identifier (GUID) for this device.
|
java.util.Date |
getDeviceTime()
Current time based on the device time zone.
|
java.util.Date |
getDeviceTime(java.util.Date date)
Adjusts the supplied date to the device time zone.
|
Command |
getLastCommand()
Gets the last command issues to the player.
|
OkHttpClient |
getOkHttpClient()
Returns an OkHttp client for making HTTP method calls in scripting
|
Schedule |
getSchedule()
Returns the active schedule or null if nothing is scheduled for the
current time.
|
Template |
getTemplate()
Currently scheduled template.
|
int |
getVersionCode()
Returns the version of the player app.
|
boolean |
isConnected()
Determine if the player has Internet connectivity.
|
java.lang.String |
newEventSession()
Starts a new event session using a generated id.
|
void |
newEventSession(java.lang.String id)
Starts a new event session using the provided id.
|
void |
print(byte[] data)
Sends a raw print command to the USB connected printer.
|
void |
print(java.lang.String text,
boolean cut) |
void |
removeConnectivityListener(ConnectivityListener listener)
Removes a previously added listener for connectivity events.
|
void |
removeOnBeaconListener(OnBeaconListener listener)
Removes a previously added listener for beacon events.
|
void |
removeOnCommandListener(OnCommandListener listener)
Removes a previously added listener for command events.
|
void |
removeOnImpressionListener(OnImpressionListener listener)
Removes the on impression listener.
|
void |
removeOnMotionListener(OnMotionListener listener)
Removes a previously added listener for motion events.
|
void |
removeOnPlayedListener(OnPlayedListener listener)
Removes a previously added listener for media played events.
|
void |
removeTemplateListener(TemplateListener listener)
Removes a previously added template listener interface.
|
void |
sendCommand(java.lang.String name,
java.lang.String arg)
Sends a command to the Controller.
|
void |
sendRemoteCommand(java.lang.String[] registrationKeys,
java.lang.String name,
java.lang.String arg)
Sends a command to remote devices identified by their registration keys.
|
void |
setBrightness(int level)
Sets the screen brightness.
|
void |
setVolume(int level)
Sets the master volume for app.
|
void |
timeEvent(java.lang.String eventName)
Time an event by including the time between this call and a later 'track' call.
|
void |
track(java.lang.String eventName,
java.util.Map<java.lang.String,java.lang.Object> properties)
Sends an event to the server with an optional map for additional event properties.
|
java.lang.String getDeviceKey()
java.util.Date getDeviceTime()
OkHttpClient getOkHttpClient()
java.util.Date getDeviceTime(java.util.Date date)
date
- int getVersionCode()
Device getDevice()
Template getTemplate()
Schedule getSchedule()
void print(byte[] data)
data
- command datavoid print(java.lang.String text, boolean cut)
text
- formatted text to pringcut
- cut paper after printvoid newEventSession(java.lang.String id)
id
- session idjava.lang.String newEventSession()
void timeEvent(java.lang.String eventName)
eventName
- name of the eventvoid track(java.lang.String eventName, java.util.Map<java.lang.String,java.lang.Object> properties)
eventName
- name of the eventproperties
- a set of properties to include with the event you're sendingCommand getLastCommand()
Controller
object with name and argument valuesjava.lang.String converse()
void sendCommand(java.lang.String name, java.lang.String arg)
name
- command namearg
- command argumentvoid sendRemoteCommand(java.lang.String[] registrationKeys, java.lang.String name, java.lang.String arg)
registrationKeys
- registration keys of devices to receive the commandname
- command namearg
- command argumentvoid setVolume(int level)
level
- 0 = mute, 100 = maxvoid setBrightness(int level)
level
- 0 = low, 100 = maxboolean isConnected()
void addTemplateListener(TemplateListener listener)
listener
- the listener interface to addvoid removeTemplateListener(TemplateListener listener)
listener
- the listener interface to removevoid addOnPlayedListener(OnPlayedListener listener)
listener
- the listener interface to addvoid removeOnPlayedListener(OnPlayedListener listener)
listener
- the listener interface to removevoid addOnCommandListener(OnCommandListener listener)
listener
- the listener interface to addvoid removeOnCommandListener(OnCommandListener listener)
listener
- the listener interface to removevoid addOnImpressionListener(OnImpressionListener listener)
listener
- the listener interface to addvoid removeOnImpressionListener(OnImpressionListener listener)
listener
- the listener interface to removevoid addOnBeaconListener(OnBeaconListener listener)
listener
- the listener interface to addvoid removeOnBeaconListener(OnBeaconListener listener)
listener
- the listener interface to removevoid addOnMotionListener(OnMotionListener listener)
listener
- the listener interface to addvoid removeOnMotionListener(OnMotionListener listener)
listener
- the listener interface to removevoid addConnectivityListener(ConnectivityListener listener)
listener
- the listener interface to addvoid removeConnectivityListener(ConnectivityListener listener)
listener
- the listener interface to remove