HTTP API or similar code to test screensaver is active
#1
Question 
Hi,

I wondered if anyone knew of a way to test from a script whether the XBMC screensaver is running?

I've looked through GUISettings.cpp for something that would be available via the HTTP API, but can't find anything that seems relevant.

Basically I'd looking to write a script to test that XBMC is idle (so I have test's for currentlyplaying and currentslide), I wanted to use the screensaver as a final confirmation that nothing was going on.

Cheers in advance,
~Dan
Please ignore the specs in my sig, just noticed how out of date they are :oo:

XBMC 10.5 r31718 (Compiled) + Transparency! 3.06, Ubuntu Minimal Server 9.11 Karmic (2.6.31-22-generic)

Asus AT3N7A-I ION Motherboard, Intel Atom 330, 4GB (2x2GB) Corsair TwinX XMS2 DDR2 PC2-6400 (800), GeForce 8300 mGPU (Built-in), 320 GB Fujitsu MHZ2320BH Notebook 2.5" SATA, LG GGC-H20L Blu-Ray & HD-ROM, PicoPSU 120W Red
Reply
#2
I think that it's been long enough that I can bump ... anyone got a suggestion?

I'm wondering though if this post might be in the wrong place and will post a similar question in the general support.
Please ignore the specs in my sig, just noticed how out of date they are :oo:

XBMC 10.5 r31718 (Compiled) + Transparency! 3.06, Ubuntu Minimal Server 9.11 Karmic (2.6.31-22-generic)

Asus AT3N7A-I ION Motherboard, Intel Atom 330, 4GB (2x2GB) Corsair TwinX XMS2 DDR2 PC2-6400 (800), GeForce 8300 mGPU (Built-in), 320 GB Fujitsu MHZ2320BH Notebook 2.5" SATA, LG GGC-H20L Blu-Ray & HD-ROM, PicoPSU 120W Red
Reply
#3
That is correct, the other forum is for actual development, this is more for releases and support threads for actual plugins / scripts.
http://forum.xbmc.org/forumdisplay.php?fid=26

I don't know how you can test whether the screensaver is active, just going to post the HTTP API commands here:
http://www.xbmc.org/wiki/?title=WebServerHTTP-API

and also to mention the XBMC builting functions - can be called through a plugin / script with xbmc.executebuiltin()
http://www.xbmc.org/wiki/?title=List_of_..._Functions
Reply
#4
Dan,

Thanks for your reply, I'd trawled through the built-in functions and HTTP API and not found anything (though I will concede that I might have missed the command that gave me what I wanted Oo).

I ended up adding a command isscreensaver active to the HTTP API myself which works quite well. It made me realise how long it's been since I've worked in C++ though!

Cheers for your help.
Please ignore the specs in my sig, just noticed how out of date they are :oo:

XBMC 10.5 r31718 (Compiled) + Transparency! 3.06, Ubuntu Minimal Server 9.11 Karmic (2.6.31-22-generic)

Asus AT3N7A-I ION Motherboard, Intel Atom 330, 4GB (2x2GB) Corsair TwinX XMS2 DDR2 PC2-6400 (800), GeForce 8300 mGPU (Built-in), 320 GB Fujitsu MHZ2320BH Notebook 2.5" SATA, LG GGC-H20L Blu-Ray & HD-ROM, PicoPSU 120W Red
Reply
#5
I was thinking that another option is to check if video / audio / pictures are "playing", check the System.IdleTime() and if longer than the "Screensaver idle timeout", that would probably mean that the screensaver is on.

But having a specific function does help, maybe you can submit your code changes as an enhancement request to be included in the base code (http://trac.xbmc.org), definitely others will find it useful as well.
Reply
#6
I am actually performing a check on audio / video / pictures in my script. The screen saver check would have just been the final check I needed. For some reason I'd never been able to get a response from the system.IdleTime() function, don't know why but anything I tried returned an error message.

I was going to look at submitting the code ... just need to read the wiki and figure how I do that Blush

As an aside, how do you query the system.idletime?
Please ignore the specs in my sig, just noticed how out of date they are :oo:

XBMC 10.5 r31718 (Compiled) + Transparency! 3.06, Ubuntu Minimal Server 9.11 Karmic (2.6.31-22-generic)

Asus AT3N7A-I ION Motherboard, Intel Atom 330, 4GB (2x2GB) Corsair TwinX XMS2 DDR2 PC2-6400 (800), GeForce 8300 mGPU (Built-in), 320 GB Fujitsu MHZ2320BH Notebook 2.5" SATA, LG GGC-H20L Blu-Ray & HD-ROM, PicoPSU 120W Red
Reply
#7
On the code change, you simply logon in trac (http://trac.xbmc.org) with the forum username / password and log a ticket for that.

Haven't used them myself, but they may work through xbmc.getCondVisibility()...
http://xbmc.sourceforge.net/python-docs/...Visibility
http://www.xbmc.org/wiki/?title=List_of_...Conditions
Reply

Logout Mark Read Team Forum Stats Members Help
HTTP API or similar code to test screensaver is active0