How to properly do GUI loop?
#1
Ok so I am working on an addon that creates an xbmcgui.Window()

...at the moment I am displaying it using doModal() and then closing it when the user hits previous...but I want this window to update as things change (it's an interface into the squeezebox music system) - so I want it to pull cover art, song titles etc, as soon as possible if there is any change.

I am just wondering what the best way to loop and do updates is...I presume I could do maybe

while true:
setProperties (check if song title, cover art etc. have changed and pull if needed)
windows.show()
sleep 0.1

..or similar...and then call close on the previous menu action? I presume the window stays showing until a close is called?

Is this system friendly - even vaguely on the right track? Basically, while this is running, it will take over the GUI system and the user will have to exit the script to get out of it, that's fine (they can re-enter and it will re-query the external system to see where it's at etc).

But I don't want to do something that's super system heavy or whatever.

Basically, I have no clue and haven't been able to find a clue with extensive searching...

Any expert help much appreciated!!
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply
#2
...also, how to stop events falling through to windows - that is, if I handle say ACTION_NEXT_ITEM in my handler, shouldn't it 'consume' the event rather than pass it through? At the moment, it works in my window, but then also tries to move the xbmc playlist along ... can that be stopped?
Addons I wrote &/or maintain:
OzWeather (Australian BOM weather) | Check Previous Episode | Playback Resumer | Unpause Jumpback | XSqueezeDisplay | (Legacy - XSqueeze & XZen)
Sorry, no help w/out a *full debug log*.
Reply

Logout Mark Read Team Forum Stats Members Help
How to properly do GUI loop?0