+ del self.infoTimer
+
+ def infoTimerFire(self):
+ currPlay = self.session.nav.getCurrentService()
+ if currPlay is not None:
+ self.updateMusicInformation( artist = currPlay.info().getInfoString(iServiceInformation.sArtist),
+ title = currPlay.info().getInfoString(iServiceInformation.sTitle),
+ album = currPlay.info().getInfoString(iServiceInformation.sAlbum),
+ genre = currPlay.info().getInfoString(iServiceInformation.sGenre),
+ clear = True)
+ self.updateCoverArtPixmap( currPlay.info().getName() )
+ else:
+ self.updateMusicInformation()
+ self.updateCoverArtPixmap( "" )
+
+ def updateMusicInformation(self, artist = "", title = "", album = "", year = "", genre = "", clear = False):
+ self.updateSingleMusicInformation("artist", artist, clear)
+ self.updateSingleMusicInformation("title", title, clear)
+ self.updateSingleMusicInformation("album", album, clear)
+ self.updateSingleMusicInformation("year", year, clear)
+ self.updateSingleMusicInformation("genre", genre, clear)
+
+ def updateSingleMusicInformation(self, name, info, clear):
+ if info != "" or clear:
+ if self[name].getText() != info:
+ self[name].setText(info)
+
+ def updateCoverArtPixmap(self, currentServiceName):
+ filename = currentServiceName
+ # The "getName" usually adds something like "MP3 File:" infront of filename
+ # Get rid of this...by finding the first "/"
+ filename = filename[filename.find("/"):]
+ path = os.path.dirname(filename)
+ pngname = path + "/" + "folder.png"
+ if not os.path.exists(pngname):
+ pngname = resolveFilename(SCOPE_SKIN_IMAGE, "no_coverArt.png")
+ if self.coverArtFileName != pngname:
+ self.coverArtFileName = pngname
+ self["coverArt"].instance.setPixmapFromFile(self.coverArtFileName)