(self, future)
lyric加载完成后的回调函数。
lyric加载完成后的回调函数。
lyric加载完成后的回调函数。
def lyricCallback(self, future):
        """lyric加载完成后的回调函数。"""
        # [00:00.00] 作曲 : cyr
        # [00:01.00] 作词 : buzz
        # [00:17.460]
        # [00:33.630] :)

        self.detailInfo.removeAllLyricLabels()
        # 初始化。
        self.count = 0
        self.order = -2
        
        result = future.result().split('\n')
        
        # set desktop lyric list.
        self.parent.player.lrc_lst = getLyric(result)

        signal = self.parent.player.timeChanged
        
        for x, i in enumerate(result):
            data = re.findall(r'\[+(.*?)\]+(.*)', i)
            # [''] or [':)']
            if not data:
                if not i:
                    continue
                else:
                    self.detailInfo.addLyricLabel(_LyricLabel('00:00', i,  x, signal, self))
                    continue

            # [00:17.460]
            if not data[0][1]:
                self.detailInfo.addLyricLabel(_LyricLabel(data[0][0], '\n',  x, signal, self))
                continue

            # [00:01.00] 作词 : buzz
            self.detailInfo.addLyricLabel(_LyricLabel(data[0][0], data[0][1],  x, signal, self))
        
        self.count = x
def lyricCallback ( self , future ) : # [00:00.00] 作曲 : cyr # [00:01.00] 作词 : buzz # [00:17.460] # [00:33.630] :) self . detailInfo . removeAllLyricLabels ( ) # 初始化。 self . count = 0 self . order = - 2 result = future . result ( ) . split ( '\n' ) # set desktop lyric list. self . parent . player . lrc_lst = getLyric ( result ) signal = self . parent . player . timeChanged for x , i in enumerate ( result ) : data = re . findall ( r'\[+(.*?)\]+(.*)' , i ) # [''] or [':)'] if not data : if not i : continue else : self . detailInfo . addLyricLabel ( _LyricLabel ( '00:00' , i , x , signal , self ) ) continue # [00:17.460] if not data [ 0 ] [ 1 ] : self . detailInfo . addLyricLabel ( _LyricLabel ( data [ 0 ] [ 0 ] , '\n' , x , signal , self ) ) continue # [00:01.00] 作词 : buzz self . detailInfo . addLyricLabel ( _LyricLabel ( data [ 0 ] [ 0 ] , data [ 0 ] [ 1 ] , x , signal , self ) ) self . count = x