コード例 #1
0
ファイル: clientapp.py プロジェクト: Aleksandre/YAM
 def _playAlbum(self, albumTitle):
     print "Album clicked, playing selected..."
     if "All" in albumTitle:
         APP.player.clear()
         for i in range(self.count()):
             item = self.item(i)
             if not "All" in item.text():
                 album = item.text()
                 tracks = content.getTracksForAlbum(album)
                 APP.player.queueTracks(tracks)
         APP.player.resume()
     else:
         tracks = content.getTracksForAlbum(albumTitle)
         if APP.player:
             APP.player.playTracks(tracks)
コード例 #2
0
ファイル: clientapp.py プロジェクト: Aleksandre/YAM
     def albumClicked(self, albumTitle):
        if "All" in albumTitle:
            tracksForArtist = content.getTracksForArtist(self.artistName)
            self.tracksTable.setTracks(tracksForArtist)
            self.tracksTable.sortByAlbum()
            pixmap = QPixmap(self.cover)
            if not pixmap:
                pixmap = QPixmap('../art/nocover1.jpg')
            scaledPixmap = pixmap.scaled(200, 200, QtCore.Qt.KeepAspectRatio, QtCore.Qt.SmoothTransformation)
            self.visibleCoverLabel.setPixmap(scaledPixmap)
        else:
            tracksForAlbum = content.getTracksForAlbum(albumTitle, self.tracks)
            self.tracksTable.setTracks(tracksForAlbum)

            if tracksForAlbum and len(tracksForAlbum) > 0:
                scaledPixmap = tracksForAlbum[0].getCoverPixmap(200)
                self.visibleCoverLabel.setPixmap(scaledPixmap)