public void Update() { this.lrcWidths = LrcController.GetWidth(this._lrcText); this.imgMask.Width = 0.0; this.showLrcText(); this.showMaskLrcText(); LrcController.lrcToolBar.Top = (base.Top - LrcController.lrcToolBar.Height) + 5.0; }
private void DrowLrcText(int index, double time) { if ((index > -1) && (index < LrcController.Lyric.LrcList.Count)) { if (this.drawIndex != index) { this.drawIndex = index; if ((this.drawIndex != 0) && (this.imgMask.Width < base.Width)) { this.imgMask.Width = base.Width; Thread.Sleep(100); } this.lrcWidths.Clear(); this._lrcText = LrcController.Lyric.LrcList[this.drawIndex].LrcText; this.lrcWidths = LrcController.GetWidth(this._lrcText); this.imgMask.Width = 0.0; this.showLrcText(); this.showMaskLrcText(); } else { string[] strArray = LrcController.Lyric.LrcList[this.drawIndex].MidTime.Split(new char[] { ',' }); int num = 0; double num2 = 0.0; num = 0; while (num < (strArray.Length - 1)) { if (num < this.lrcWidths.Count) { num2 += (double)this.lrcWidths[num]; } double num3 = Convert.ToDouble(strArray[num]); double num4 = Convert.ToDouble(strArray[num + 1]); if ((time >= num3) && (time <= num4)) { this.imgMask.Width = num2 - (((num4 - time) / (num4 - num3)) * ((double)this.lrcWidths[num])); return; } num++; } if (time >= Convert.ToDouble(strArray[num])) { if ((LrcController.Lyric.LrcList[this.drawIndex].EndTime - Convert.ToDouble(strArray[num])) > 0.0) { this.imgMask.Width = num2 + (((time - Convert.ToDouble(strArray[num])) / (LrcController.Lyric.LrcList[this.drawIndex].EndTime - Convert.ToDouble(strArray[num]))) * ((double)this.lrcWidths[num])); } else { this.imgMask.Width = num2 + ((double)this.lrcWidths[num]); } } } } }