dimming the lights when VLC is running
Posted: 15 Jul 2012 07:41
My goal is to have my room lights dim when VLC is playing a video track, then raise the lights when it's done. I'm controlling the lights via X10 and have worked out a shell command for each action. What I'm stuck on now is how can I write a function for VLC to have it call my shell command when media starts, and call another command when it's done?
I have considered a python script that just polls for running processes, dimming the lights whenever VLC is running, but that seems inefficient and wouldn't be able to tell when VLC is actually playing, so I'm hoping a better route is available. Reading around VLC developer docs, there seem to be a few ways to go about this using a plugin module, but my coding comfort zone is more around scripting than actual C/C++ development. So,I'm wondering if there's anything existing that I could adapt or (assuming probably not) would it be possible to do this via a LUA script?
I've played around a little bit using a LUA playlist script and can get it to call my command using io.popen when reading a http stream, but as far as I can tell the script will only run on web streams. It doesn't get called when I run it on files on my local PC, even if I just "return true" in probe(). There's also the matter of raising the lights after the track is done that I haven't worked out.
So, is what I'm asking possible within VLC's scripting support? Am I on the right track, or can you recommend a more straightforward way?
I have considered a python script that just polls for running processes, dimming the lights whenever VLC is running, but that seems inefficient and wouldn't be able to tell when VLC is actually playing, so I'm hoping a better route is available. Reading around VLC developer docs, there seem to be a few ways to go about this using a plugin module, but my coding comfort zone is more around scripting than actual C/C++ development. So,I'm wondering if there's anything existing that I could adapt or (assuming probably not) would it be possible to do this via a LUA script?
I've played around a little bit using a LUA playlist script and can get it to call my command using io.popen when reading a http stream, but as far as I can tell the script will only run on web streams. It doesn't get called when I run it on files on my local PC, even if I just "return true" in probe(). There's also the matter of raising the lights after the track is done that I haven't worked out.
So, is what I'm asking possible within VLC's scripting support? Am I on the right track, or can you recommend a more straightforward way?