-
Notifications
You must be signed in to change notification settings - Fork 130
Using xAP and xPL Displays
Note: If you are new to xAP or xPL, please begin by reading xAP and xPL - Getting Started.
Most users are familiar with using the "speak" command to output speech to one or more devices. There exists a similar capability for sending messages to display devices. These devices may be physical (e.g., a VFD like those used in squeezeboxes) or virtual (like the system pop-up that can run on win32 systems).
Begin by declaring "display_rooms" within your local mh.ini file using the syntax: code display_rooms=<room></room> => schema=<schema_name></schema_name> address=<target></target> device=<devicetype></devicetype>[,] code where:
- <room></room> is any room name that you would like to use (spaces and punctuation are not permitted)
- <schema_name></schema_name> is a valid schema name. Currently, only message.display (for xAP) and osd.basic (for xPL) are supported.
- <target></target> is the xAP or xPL target. Examples are: mi4.intranetlaunch.castor (for xAP) and slimdev-slimserv.softsqueeze (for xPL)
- <devicetype></devicetype> is either xap or xpl (note lowercase)
family_room => schema=osd.basic address=slimdev-slimserv.squeezebox device=xpl
code This provides declarations for two rooms: castor (a roving laptop display) and family_room (a squeezebox display).
Now that a set of display "rooms" are defined, you use them in a manner very similar to targeting speech to specific devices. Either you (1) manually specify the "display_rooms" argument when calling display or (2) you map one or more display rooms to a display_apps param. The first method allows explicit control (which is occasionally needed) within your user code logic as well as skips any requirement for creating the application to room "mapping". An example looks like: code &display("display_rooms=castor,living_room My message"); code where the "My message" portion is what is sent to the displays. Note that the above command allows a way of embedding display logic that can combine different devices using different schemas and protocols (e.g., both xPL and xAP).
If the second technique is preferred (and, doing so allows changes to configurations to be much easier), then declare a "display_apps" param in mh.ini using the syntax: code display_apps=<app_name></app_name> => display_rooms=<room></room>[|<room2></room2>...] duration=<duration></duration>[,] code where:
- <app_name></app_name> is any application name that you want to use (excepting punctuation and spaces)
- <roomx></roomx> is a room name that is already declared. Multiple rooms are delimited by a single pipe "|" character
- <duration></duration> is the duration to display the message (optional; the default is "10" if not specified)
The discussion above provides a path for controlling messages specific to display devices. But, what if you simply want to "echo" what is already being spoken? If this is appealing, then the easiest way is to simply include the "echo" param in your speak call, like: code speak("echo=xap|xpl System is shutting down in 30 seconds"); code This example not only speaks the message but also broadcasts the message to every xAP or xPL device that exists (the display logic picks the standard message.display and osd.basic schemas by default).