2012-09-27, 22:09
I'm trying to write a script that will will run when I start playing a video. I want the script to do two things. First, I would like to be able to figure out what the aspect ratio of the video is and send the appropriate zoom command to my projector. Second, I would like to send an http command to my automatic lights to dim the lights in the media room.
The script would be pretty simple and have the basic logic as follows:
on play
get aspect ratio
if aspect ratio = 2.35
then
zoom wide
else
zoom 16:9
dim lights
on stop
zoom 16:9
turn on lights
I've coded in c, c++, php, javascript, etc. Learning python seems pretty straightforward. What I am having a hard time finding is the xbmc specific stuff. In particular, how do I get a script to automatically run at startup (if that is even possible). Can I get xbmc to call my script when it starts to play a video, or would I have to alter the source code (likely beyond my expertise).
Thanks in advance for any help and/or advice,
Andy
The script would be pretty simple and have the basic logic as follows:
on play
get aspect ratio
if aspect ratio = 2.35
then
zoom wide
else
zoom 16:9
dim lights
on stop
zoom 16:9
turn on lights
I've coded in c, c++, php, javascript, etc. Learning python seems pretty straightforward. What I am having a hard time finding is the xbmc specific stuff. In particular, how do I get a script to automatically run at startup (if that is even possible). Can I get xbmc to call my script when it starts to play a video, or would I have to alter the source code (likely beyond my expertise).
Thanks in advance for any help and/or advice,
Andy