コード例 #1
0
 public void StartTranlateLrc(LyricCollection lc)
 {
     if (GetTransResultThread != null && GetTransResultThread.IsAlive)
     {
         return;
     }
     GetTransResultThread = new Thread(new ParameterizedThreadStart(TranslateLrcWork));
     GetTransResultThread.Start(lc);
 }
コード例 #2
0
        void TranslateLrcWork(object olc)
        {
            LyricCollection lc = (LyricCollection)olc;

            foreach (Lyric lrc in lc.mLrcList)
            {
                Lyric newlrc = new Lyric()
                {
                    Word = lrc.Word, Timeline = lrc.Timeline
                };
                try
                {
                    newlrc.Word = GetTransResult(newlrc.Word);
                }
                catch
                {
                    newlrc.Word = "Error";
                    return;
                }
                OnTransLrcGet?.Invoke(newlrc);
            }
        }