Operation
The operation of xPLMCE is entirely concerned with the sending and receiving of xPL messages.
Sending commands to Media Center.
For xPLMCE to respond to commands, the xPL messages must be specifically targeted to it. Messages with a target=* are ignored. xPL addresses are of the form "vendor-device.instance". For xPLMCE, the vendor and device are "mal" and "mce" respectively. Usually the instance name can be modified, but this is not supported in xPLMCE, because it consists of several components that cannot be configured in xPLHal and need to assume what the target address of the main xPLMCE application will be. The instance is therefore derived automatically, using the computer name, except when running as a remote client (such as a media center extender), where the default user name is used instead. The complete address is displayed in xPLHal.
Media Playback
xPL commands to control media playback use the media.basic schema. The schema uses the concept of "Media Players", where each player can be responsible for a different class of media. xPLMCE reports Media Center as having five different media players - Audio, Video, Photo, TV and Radio.
Messages should be targeted to the appropriate player for the media. Audio covers both streaming audio from a network share, from shoutcast stream or playing directly from a CD drive. Video supports playback of pre-recorded video files (including DVD data from a hard drive) as well as playback from a DVD drive, while the TV player is only concerned with live TV.
Note: At this stage there is no xPL support for recording live TV, because recording commands in Media Center have to be programmed via the EPG, and cannot be started and stopped directly.
An example message is shown below. This message will cause the audio player to start playing the mp3 file, with the specified visualization. Note: The visualization elements are a Media Center specific extension to the schema (and are therefore not mentioned in the official schema definition). The names used must be separated by a colon and are case sensitive (this is a Media Center restriction that cannot be avoided).
xpl-cmnd
media.basic
{
command=queue
mp=audio
url=c:/music/rock - pop/muse/absolution/08 - Hysteria.mp3
playnow=true
visualization=Battery:Randomization
}
On screen notifications
Aside from the media schema, xPLMCE also responds to two other kinds of message - cid.basic and osd.basic. These message schemas are used for Caller ID and On-Screen-Display notifications respectively.
Caller ID messages are always trigger messages rather than commands, and do not need to be targeted explicitly at xPLMCE. When a Caller ID message is received, the phone number is displayed in a popup dialog until cancelled using the remote. If you do not want caller id messages to trigger popups, this feature can be unchecked in the Configure application.
If using the Meteor Caller ID system, the popup will only appear when the message body contains ccs=cid or ccs=nocid, as described in the cid.meteor schema.
OSD messages are displayed if received in a command message specifically targeted at xPLMCE. Media Center does not support a true On-Screen-Display, so these messages are displayed in a popup dialog instead. For this reason, only osd.basic messages with command=write are accepted, and the entire text element is displayed, with any row and column elements ignored.
Messages sent by Media Center
Aside from the user-defined messages triggered via the remote control and popup menu, all messages broadcast by xPLMCE are status or trigger messages from the media schema family. Status messages are sent only in response to incoming media.request commands. Trigger messages are sent when there is a change in the status of Media Center. To minimise the size of individual messages, three different triggers messages are used:
media.mpmedia:
sent when a new media file is started (provides the album, artist, track etc). Note that due to shortcomings in Media Center, no media information is available when playing DVD files.
media.mptrnspt:
sent when the playback mode changes (play, stop, pause, forward, rewind),
or when the position in the media changes (if position updates were enabled during configuration),
or when a DVD starts a new chapter.
media.mpconfig:
sent when the media player configuration changes (volume, mute, etc).
For example, to dim the lights when a movie starts, xPLHal would only need to watch for media.mptrnspt messages containing both mp=video and command=play.
These messages are sent regardless of whether the Media Center activity was triggered by the user via the Media Center menus or by an external xPL command.
Next: Technical Notes






