def run(self):
'''Main run loop for the background thread'''
last_title = ""
monitor = xbmc.Monitor()
while not monitor.abortRequested() and self.active:
cur_playback = self.get_curplayback()
if cur_playback and cur_playback.get("item"):
if cur_playback["shuffle_state"] != self.dialog.shuffle_state:
self.toggle_shuffle(cur_playback["shuffle_state"])
if cur_playback["repeat_state"] != self.dialog.repeat_state:
self.set_repeat(cur_playback["repeat_state"])
if cur_playback["is_playing"] != self.dialog.is_playing:
self.toggle_playstate(cur_playback["is_playing"])
cur_title = cur_playback["item"]["uri"]
if cur_title != last_title:
last_title = cur_title
trackdetails = cur_playback["item"]
self.update_info(trackdetails)
monitor.waitForAbort(2)
del monitor
评论列表
文章目录