def __init__(self, parent=None): super(LrcWorker, self).__init__(parent) self._lrcDir = LRCPath self.lrcParser = LrcParser() self._currentText = '' self._lineMode = 1 self.initConnect()
def getLrcContent(self, artist, title): lrcParser = LrcParser() if title: lrc_path = self.getLrcPath(artist, title) if lrc_path and os.path.exists(lrc_path): lrcParser.set_filename(lrc_path) else: artist = artist.encode('utf-8') title = title.encode('utf-8') lrc_path = self.multiple_engine(lrc_path, artist, title) if lrc_path: lrcParser.set_filename(lrc_path) if hasattr(lrcParser, 'scroll_lyrics'): return lrcParser.scroll_lyrics else: return []