[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...)
(2014-06-24, 06:16)invision Wrote: Firstly, what exactly does the idle_time command setting do in the addon? The default i believe is set to 10 minutes. What exactly does this mean? I set it to 1 minute, but i don't actually know what it does! If i hardcode it in settings.xml and set it to 0, what effect does that have? Can't find an explanation anywhere in the addon.

idle_time is the time you consider XBMC being idle Smile Seriously, after "idle_time" minutes of XBMC doing nothing, the "script_idle" will be called.

Quote:Secondly, what happens if i press pause [which executes script1] and play [which executes script2] in quick succession, will it wait for script 1 to finish before executing script 2? Or will it run them both at the same time if script1 hasn't finished yet?

Right now this service addon *does* wait for the script to finish so in theory script 2 will be executed *after* script 1 is finished.

Quote:Thirdly, is there any way to distinguish between the type of media being played by XBMC?
So for example,

if "video" content resumes or starts (TV Shows, Movie, YouTube Stream etc), i want to run LightsOff.sh
if "audio" content resumes or starts (Music from music library, internet radio stream etc), i want to run LightsOn.sh

I'd like to keep my ambient lights when i'm relaxing and listening to music, but if a tv show/movie/any video content is playing back, i want to turn the lights off using the addon. Would this be possible with your add on ? : )

It should be possible,right now the addon calls the script with an argument saying "video" or "music". You can read the argument in your script like this (in python):

Code:
#!/usr/bin/env python

import sys
if  'music' in sys.argv[1]:
  # do things
Reply


Messages In This Thread
Great! - by gnorf - 2013-02-27, 22:50
RE: [RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...) - by pilluli - 2014-06-24, 20:42
[RELEASE] Pilulli Revisited - by KenV99 - 2014-06-28, 18:18
Logout Mark Read Team Forum Stats Members Help
[RELEASE] Execute user scripts on specific XBMC actions (play starts/stops...)4