def showPopup(self): self.show() xbmc.sleep(Settings.getNotificationDisplayDuration()) self.close()
# Check to see if the playing track has changed if (track is not None) and ((lastDisplayedTrack is None) or (track['uri'] != lastDisplayedTrack['uri'])): # Update the last displayed track to the current one lastDisplayedTrack = track # Only display the dialog if it is playing if isActive: if Settings.useXbmcNotifDialog(): log("SonosService: Currently playing artist = %s, album = %s, track = %s" % (track['artist'], track['album'], track['title'])) # Get the album art if it is set (Default to the Sonos icon) albumArt = __icon__ if track['album_art'] != "": albumArt = track['album_art'] # Gotham allows you to have a dialog without making a sound xbmcgui.Dialog().notification(track['artist'], track['title'], albumArt, Settings.getNotificationDisplayDuration(), False) else: sonosPopup = SonosPlayingPopup.createSonosPlayingPopup(track) sonosPopup.showPopup() del sonosPopup except: # Connection failure - may just be a network glitch - so don't exit log("SonosService: Error from speaker %s" % Settings.getIPAddress()) log("SonosService: %s" % traceback.format_exc()) # No longer the first start justStartedService = False # Reset the timer for the next check timeUntilNextCheck = Settings.getNotificationCheckFrequency()