def __init__(self, song, pos): QTreeWidgetItem.__init__(self) self.song = song self.pos = pos self.setText(0, mpdlibrary.songArtist(song)) self.setText(1, mpdlibrary.songTitle(song)) self.setText(2, mpdlibrary.songAlbum(song))
def __init__(self, song, pos): QTreeWidgetItem.__init__(self) self.song = song self.pos = pos self.setText(0,mpdlibrary.songArtist(song)) self.setText(1,mpdlibrary.songTitle(song)) self.setText(2,mpdlibrary.songAlbum(song))
def __init__(self, song): QTreeWidgetItem.__init__(self) self.song = song self.setText(0,mpdlibrary.songTrack(song)) self.setText(1,mpdlibrary.songTitle(song)) self.setText(2,mpdlibrary.songTime(song)) self.setToolTip(1, "Artist:\t %s\nAlbum:\t %s\nFile:\t %s"\ % (mpdlibrary.songArtist(song), mpdlibrary.songAlbum(song), song['file']))
def __init__(self, song): QTreeWidgetItem.__init__(self) self.song = song self.setText(0, mpdlibrary.songTrack(song)) self.setText(1, mpdlibrary.songTitle(song)) self.setText(2, mpdlibrary.songTime(song)) self.setToolTip(1, "Artist:\t %s\nAlbum:\t %s\nFile:\t %s"\ % (mpdlibrary.songArtist(song), mpdlibrary.songAlbum(song), song['file']))
def __init__(self, song, oneLine=False): QListWidgetItem.__init__(self) self.icon = False self.song = song if oneLine: self.setText(mpdlibrary.songArtist(song) + ' - ' + mpdlibrary.songTitle(song)) else: self.setText(mpdlibrary.songTitle(song) + '\n' + mpdlibrary.songArtist(song)) self.setToolTip("Album:\t %s\nTime:\t %s\nFile:\t %s" % (mpdlibrary.songAlbum(song), str(mpdlibrary.songTime(song)) , song['file']))
def _updateText(self): if not self._playing and mpdlibrary.isStream(self.song): title = mpdlibrary.songStation(self.song) artist = '' else: artist = mpdlibrary.songArtist(self.song) title = mpdlibrary.songTitle(self.song) if self.oneLine: self.setText(artist + ' - ' + title) else: self.setText(title + '\n' + artist) if mpdlibrary.isStream(self.song): self.setToolTip("Station:\t %s\nurl:\t %s" % (mpdlibrary.songStation(self.song), self.song['file'])) else: self.setToolTip("Album:\t %s\nTime:\t %s\nFile:\t %s" % (mpdlibrary.songAlbum(self.song), str(mpdlibrary.songTime(self.song)) , self.song['file']))
def _updateText(self): if not self._playing and mpdlibrary.isStream(self.song): title = mpdlibrary.songStation(self.song) artist = '' else: artist = mpdlibrary.songArtist(self.song) title = mpdlibrary.songTitle(self.song) if self.oneLine: self.setText(artist + ' - ' + title) else: self.setText(title + '\n' + artist) if mpdlibrary.isStream(self.song): self.setToolTip( "Station:\t %s\nurl:\t %s" % (mpdlibrary.songStation(self.song), self.song['file'])) else: self.setToolTip( "Album:\t %s\nTime:\t %s\nFile:\t %s" % (mpdlibrary.songAlbum(self.song), str(mpdlibrary.songTime(self.song)), self.song['file']))
def songIcon(self, song): '''Try to get a cover image from folder.jpg, if that fails. Get an album cover from the interwebs. If it can't find an album cover it tries to get a picture of the artist.''' # comment out the next line to disable icon fetching. #return NOCOVER if song['file'].startswith('http://'): return STREAMICON cover = None cover = self.getFolderImage(song) if not cover: #print 'debug: no folder.jpg' if not self.coverPath: return NOCOVER try: artist = mpdlibrary.songArtist(song) album = mpdlibrary.songAlbum(song) if artist: if album: cover = self.getAlbumImage(artist,album) if not cover: cover = self.getArtistImage(artist) except Exception, e: print 'error: in iconretriever', e
def songIcon(self, song): '''Try to get a cover image from folder.jpg, if that fails. Get an album cover from the interwebs. If it can't find an album cover it tries to get a picture of the artist.''' # comment out the next line to disable icon fetching. #return NOCOVER if mpdlibrary.isStream(song): return STREAMICON cover = None cover = self.getFolderImage(song) if not cover: #print 'debug: no folder.jpg' if not self.coverPath: return NOCOVER try: artist = mpdlibrary.songArtist(song) album = mpdlibrary.songAlbum(song) if artist: if album: cover = self.getAlbumImage(artist,album) if not cover: cover = self.getArtistImage(artist) except Exception, e: print 'error: in iconretriever', e