Can a ListItem constructor be passed a function that will be called asynchrously? - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=26) +--- Thread: Can a ListItem constructor be passed a function that will be called asynchrously? (/showthread.php?tid=28619) |
Can a ListItem constructor be passed a function that will be called asynchrously? - NewNole2001 - 2007-09-19 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 - Nuka1195 - 2007-09-19 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 |