Can a ListItem constructor be passed a function that will be called asynchrously?
#1
Is it possible to set the label for a ListItem to a function that will return a string?

I would figure this out on my own, but am at work, so I can't for about 10 hours.

The reason I ask is that I am considering updating the XM4XMRO script to make it a plugin. XM sends a continuous WMA stream, with metadata accessed via a separate http call. I need to be able to change the listitem's label every thirty seconds or so, after getting the new data from XM.

Is this possible?

Also, based on what I see in the docs, there is no way to programmatically set the information that XBMC displays for a track (Artist/Title, etc). Is this correct?

Thanks
Reply
#2
1. no, you can set it to a string, then run exec "self.%s()" % listitem.getLabel() or something similar, probably not what you want. It won't update automatically.
I would just use the setLabel() yourself. You don't have to delete and repopulate the list.

Quote:Also, based on what I see in the docs, there is no way to programmatically set the information that XBMC displays for a track (Artist/Title, etc). Is this correct?

Lookup setInfo() method for the listitem. should be in the new pydocs
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply

Logout Mark Read Team Forum Stats Members Help
Can a ListItem constructor be passed a function that will be called asynchrously?0