2012-02-14, 07:29
Ok I am developing a XBMC<>Squeezebox bridge (http://forum.xbmc.org/showthread.php?p=1012231) - and by and large it's going well. Source code is here:
http://code.google.com/p/bossanova808-xb...t.xsqueeze
Obviously, I want to tie into XBMC eye candy and the mad skills of the various skinners, so I am trying to write this in a skinner friendly way.
Thus I moved over from window to windowXML recently...this has brought with it numerous issues.
QUESTION1:
First, I get constant errors:
...I am reasonably confident they are not my fault, and I have no idea where they are coming from really, as they only appeared with the WindowXML change.
Can I do anything about these?
Question 2
I am unsure how best to do a GUI loop - that is, my addon is basically a 'Now Playing' display for an external media player. It needs to update all the time, and capture remote control events, and pass to the client. There seems to be two ways of doing this, basically
a) window.doModal() and kick off an updating thread in OnInit
b) a simple loop...and this MUST have an xbmc.sleep in it or I don't get events:
I am using b) at the moment.
I notice some odd things - when I handle a remote event, like next_item (so FF->] if you see what I mean) - this gets passed to my player....but also seems to go through to XBMC itself and I get a popup 'can't find item next item on playlist'. I think this is something to do with window.show() and events and the sleep, but I can't find any good info on how this works.
I am guessing if I doModal() this might not happen as all events will be absorbed by the window?? But I am not sure how cool XBMC is with multi-threaded plugins, and my initial testing of this seemed to crash XBMC fairly frequently.
Is there anyone who can confirm the best way to do a safe, high performing dynamically updating window in an XBMC addon?
Question 3
To make things easy on the skinner, my initial idea was to populate the $INFO thing with lots of handy data - names of current images for cover art, text for titles etc etc. However, there doesn't seem to be access to this (I assumed, wrongly I think, this is what windowXML.setProperty did??) - instead one has to do the more laborious access by control number thing I think? Which also forces the skinner to implement all those controls (well, unless you do a lot of try: excepting...) - and keep those numbers. Have I missed the obvious and can one set info labels for a plugin created windowXML??
Question 4
Can one take over & directly invoke the XBMC NowPlaying window, so to speak - that is, can I set the appropriate INFO labels and actually use the existing NowPlaying infrastructure with the external player...this would be the most integrated approach I think, and instantly give all skins compatibility I guess. But I'd have to be able to grab all the remote events and remap them to the external controls still. Even trying this will be very time consuming so I want to get an idea if it's possible before I waste many hours on it!!
Question 5
Images are an issue - most of the time, I have cover art. Sometimes, a default image is returned by Logitech Music Server, and sometimes no image.
With the default images, I get Warning JPEGIO error - not a real jpeg, starts with x20 or something (sorr don't have the exact message to hand) - but they do display correctly on screen despite this message. I suspect the server might actually be returning pngs in this case (you call it with ?cover.jpg on the URL but I don't think that means per se it's a jog coming back, unfortunately). I am not sure how to deal with this....
The no image thing is an issue - if I delete the images everytime, the come and go on track change (via urllib.retrieve()), and sometimes aren't present when the screen is re-drawn (well, I think this is what is happening as I presume urllib.retrieve is threaded or something??) - so they don't get drawn. Problem is, they never come back once that happens, even when the become present again. Note I am not explicitly calling window.setImage and maybe I should be? I guess the basic question - is there a proper way to clear an image from a window, such that when I re-set it it will come back?
OK any and all help MUCH appreciated - I have made really good progress and it by and large works, but it could be much better than it is if I can get into my head better how all this works and the documentation is ... sparse!
I am hoping some of you xbmc/python experts can help me out here...
http://code.google.com/p/bossanova808-xb...t.xsqueeze
Obviously, I want to tie into XBMC eye candy and the mad skills of the various skinners, so I am trying to write this in a skinner friendly way.
Thus I moved over from window to windowXML recently...this has brought with it numerous issues.
QUESTION1:
First, I get constant errors:
Code:
15:25:46 T:3472 ERROR: CLocalizeStrings::ClearBlock: Trying to cl"ear non existent block C:\Users\X\AppData\Roaming\XBMC\addons\script.xsqueeze
...I am reasonably confident they are not my fault, and I have no idea where they are coming from really, as they only appeared with the WindowXML change.
Can I do anything about these?
Question 2
I am unsure how best to do a GUI loop - that is, my addon is basically a 'Now Playing' display for an external media player. It needs to update all the time, and capture remote control events, and pass to the client. There seems to be two ways of doing this, basically
a) window.doModal() and kick off an updating thread in OnInit
b) a simple loop...and this MUST have an xbmc.sleep in it or I don't get events:
Code:
window.running = True
while window.running:
window.show()
window.update()
xbmc.sleep(10)
I am using b) at the moment.
I notice some odd things - when I handle a remote event, like next_item (so FF->] if you see what I mean) - this gets passed to my player....but also seems to go through to XBMC itself and I get a popup 'can't find item next item on playlist'. I think this is something to do with window.show() and events and the sleep, but I can't find any good info on how this works.
I am guessing if I doModal() this might not happen as all events will be absorbed by the window?? But I am not sure how cool XBMC is with multi-threaded plugins, and my initial testing of this seemed to crash XBMC fairly frequently.
Is there anyone who can confirm the best way to do a safe, high performing dynamically updating window in an XBMC addon?
Question 3
To make things easy on the skinner, my initial idea was to populate the $INFO thing with lots of handy data - names of current images for cover art, text for titles etc etc. However, there doesn't seem to be access to this (I assumed, wrongly I think, this is what windowXML.setProperty did??) - instead one has to do the more laborious access by control number thing I think? Which also forces the skinner to implement all those controls (well, unless you do a lot of try: excepting...) - and keep those numbers. Have I missed the obvious and can one set info labels for a plugin created windowXML??
Question 4
Can one take over & directly invoke the XBMC NowPlaying window, so to speak - that is, can I set the appropriate INFO labels and actually use the existing NowPlaying infrastructure with the external player...this would be the most integrated approach I think, and instantly give all skins compatibility I guess. But I'd have to be able to grab all the remote events and remap them to the external controls still. Even trying this will be very time consuming so I want to get an idea if it's possible before I waste many hours on it!!
Question 5
Images are an issue - most of the time, I have cover art. Sometimes, a default image is returned by Logitech Music Server, and sometimes no image.
With the default images, I get Warning JPEGIO error - not a real jpeg, starts with x20 or something (sorr don't have the exact message to hand) - but they do display correctly on screen despite this message. I suspect the server might actually be returning pngs in this case (you call it with ?cover.jpg on the URL but I don't think that means per se it's a jog coming back, unfortunately). I am not sure how to deal with this....
The no image thing is an issue - if I delete the images everytime, the come and go on track change (via urllib.retrieve()), and sometimes aren't present when the screen is re-drawn (well, I think this is what is happening as I presume urllib.retrieve is threaded or something??) - so they don't get drawn. Problem is, they never come back once that happens, even when the become present again. Note I am not explicitly calling window.setImage and maybe I should be? I guess the basic question - is there a proper way to clear an image from a window, such that when I re-set it it will come back?
OK any and all help MUCH appreciated - I have made really good progress and it by and large works, but it could be much better than it is if I can get into my head better how all this works and the documentation is ... sparse!
I am hoping some of you xbmc/python experts can help me out here...