Running python-scripts on events(play/pause)
#1
hi all!

i would like python-scripts to be started when certain events happen. e.g. i would like a python-script to run every time the user starts to play a movie. is this supported by xboxmediacenter?

the reason i need this is that i use x10 to control lighting in my appartment. what would be great was if i could make the xbox communite with the x10 system (through a server). this way i could have the lighing automatically turned off when i start watching a movie on the xbox. then, if i push pause the lighting is turned back on. when i push play the lighting is turned off, and when the movie is over, the lighting is turned on.

i would do this by having a python-script sending requests over the network to the server. but i need to know if it is possible to hook python-scripts up to these kind of events, so it would be nice if you experts could tell if this is possible in real life and not just in my mind. :-)



Reply
#2
the closest thing i could think of is to edit keymap.xml to have a key action that launches the script in that window. it would still require two button presses though. one to launch the script and one to play the movie.

in theory you could grab the my video window by the window id and add a catch to its 'oncontrol' method but am pretty sure that doesnt work (i have never been able to get any of the real windows to interact with python).
Reply
#3
good idea!
another use would be to play a random movie trailer before the actual movie.
Reply

Logout Mark Read Team Forum Stats Members Help
Running python-scripts on events(play/pause)0