예제 #1
0
 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))
예제 #2
0
 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))
예제 #3
0
 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']))
예제 #4
0
 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']))
예제 #5
0
 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']))
예제 #7
0
 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']))
예제 #8
0
 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
예제 #9
0
 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