As of version 0.3 it has the following capability:
Dialogs - Generate interactive dialogs and receive a response.
Query - Query whether it is playing content.
Control - Play, Pause or stop content.
Variables within the input string must be | separated.
The current options available are:
// 0. Custom Buttons, time, message, title, optional image
// 1. Simple passive dialog, time, message, title
// 2. Simple passive dialog, time, message, title, image
// 3. Simple interactive dialog (ok cancel), time, message, title
// 4. Simple interactive dialog (ok cancel), time, message, title, image
where time is the delay before hiding the dialog. The useful thing about this addin is that it sends the pressed button back to the source. This means that you can write a program in python, generate a dialog in media center and find out what the user selected (or if the message timed out).
The following python program generates the dialog, which displays for a maximum of 30 seconds and then displays the user response.
Code: Select all
import socket TCP_IP = '127.0.0.1' TCP_PORT = 1982 BUFFER_SIZE = 4096 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) MESSAGE = "Dialog|3|30|Hello MCE User|This is a message!" s.connect((TCP_IP, TCP_PORT)) s.send(MESSAGE) data = s.recv(BUFFER_SIZE) print data
MCEPopups allows user defined buttons and will return the text string specified for the label of the selected button. Buttons are ":" separated. The text string required to generate the following popup (without the thumbnail) would be:
MESSAGE = "Dialog|0|Video:Voice:Reject|30|Incoming call from nxsfan-mobile|ACCEPT THE CALL?"
Selecting Voice would return the text string "Voice"
The query capability is extremely simple. Currently the only option is Query -> Playstate. The input string needs to be formatted as "Query|Playstate".
It will return Playing, Paused or null if there is no loaded content.
I will probably added metadata query functionality later (but currently have no need for it).
NB I am not using MSAS. I don't have the MSAS sample namespace working in C#2010. Not sure if it is required for advanced functionality now it is deprecated? Input would be useful.
Control is also very simple. You can Play, Pause or Stop the Media Center
You can download the addin here: http://nxsfan.co.uk/MCEPopups/MCEPopups.0.3.msi
Please request features, provide feedback, etc.
0.3 - Add capability for custom buttons
0.2 - Add media query and media control options