Get currently displayed XBMC screen via API
#1
Is there a way that i can query XBMC via one of the APIs in order to retrieve the currently displayed screen (eg, home, movie/tv library, movie/tv info etc).
Ideally i'd like to use the JSON api, but i can't see a method that seems to match.

Sorry if this info is somewhere. I've had a look through the JSON changes sticky and also the v3 docs. Hopefully I haven't just missed it.

Thanks for the help Big Grin
Reply
#2
The only way to currently do this is to run XBMC.GetInfoLabels over JSON-RPC and request the following infolabel "System.CurrentWindow". But I don't recommend using GetInfoLabels because it is deprecated and might sometimes return wrong information.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
Thanks Montellese.
As its been deprecated does that mean its likely to be replaced by something at some point?

Cheers,
Reply
#4
Ooh, not sure how i didn't find this last night, must have been tired.
Would the getCurrentWindowId() function work from the python docs? (Sorry can't test for a few days as away)
http://xbmc.sourceforge.net/python-docs/...ntWindowId

I notice the Window object has a getProperty:
http://xbmc.sourceforge.net/python-docs/...etProperty
It says its "similar to an infolabel". More reliable?

Cheers
Reply
#5
I don't really know about the python stuff but that might work yeah.

Concerning XBMC.GetInfoLabels: Ideally it will be removed someday but it won't be that soon I guess because a lot of people still rely on the info labels. Concerning your specific case I already have some code that will expose the id and label of the current window through GUI.GetProperties (not available for Eden).
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#6
Coolio, cheers.

I'll have a play when i get the chance in the few days and see what i come up with. I only need to detect a few screens (movie lib, tv lib, movie info, tv info) so infolabels might work.

I'll attempt the python side, but i'm on windows now so i'm not sure how to even get python up and running with the xbmc libs tbh.
Reply

Logout Mark Read Team Forum Stats Members Help
Get currently displayed XBMC screen via API0