示例#1
0
        public static async void LoadLyrics(HyPlayItem hpi)
        {
            if (hpi.ItemType == HyPlayItemType.Netease && hpi.AudioInfo.Lyric == null)
            {
                PureLyricInfo lrcs = await LoadNCLyric(hpi);

                hpi.AudioInfo.Lyric   = lrcs.PureLyrics;
                hpi.AudioInfo.TrLyric = lrcs.TrLyrics;
            }
            //先进行歌词转换以免被搞
            Lyrics = Utils.ConvertPureLyric(hpi.AudioInfo.Lyric);
            Utils.ConvertTranslation(hpi.AudioInfo.TrLyric, Lyrics);
            Invoke(() => OnLyricLoaded?.Invoke());
        }
示例#2
0
        public static async void LoadLyrics(HyPlayItem hpi)
        {
            if (hpi.ItemType == HyPlayItemType.Netease && hpi.AudioInfo.Lyric == null)
            {
                PureLyricInfo lrcs = await LoadNCLyric(hpi);

                hpi.AudioInfo.Lyric   = lrcs.PureLyrics;
                hpi.AudioInfo.TrLyric = lrcs.TrLyrics;
            }

            //先进行歌词转换以免被搞
            Lyrics = Utils.ConvertPureLyric(hpi.AudioInfo.Lyric);
            Utils.ConvertTranslation(hpi.AudioInfo.TrLyric, Lyrics);
            if (Lyrics.Count != 0 && Lyrics[0].LyricTime != TimeSpan.Zero)
            {
                Lyrics.Insert(0, new SongLyric()
                {
                    HaveTranslation = false, LyricTime = TimeSpan.Zero, PureLyric = ""
                });
            }
            lyricpos = 0;
            Common.Invoke(() => OnLyricLoaded?.Invoke());
        }