Esempio n. 1
0
 private void Play()
 {
     if (Core.PlayList.Count == 0)
     {
         return;
     }
     Mini_UpdateTimer.Enabled = true;
     Core.Play();
     Mini_Seek_TrackBar.Enabled = true;
     SetPlay(false);
     Mini_Stop.Enabled           = true;
     Mini_Seek_TrackBar.MaxValue = (int)Core.Durnation * 1000;
     Mini_Artist_Label.Refresh();
     Mini_Title_Label.Refresh();
     Artist = Core.CurrentBeatmap.Artist;
     Title  = Core.CurrentBeatmap.Title;
 }
Esempio n. 2
0
        private void GUITimer_Tick(object sender, EventArgs e)
        {
            var Rects = new Rectangle(Left, Top, Left + Width, Top + Height);

            if ((Top < 0 && Win32.PtInRect(ref Rects, Cursor.Position)))
            {
                Top = 0;
            }
            else
            {
                if (Top > -5 && Top < 5 && !(Win32.PtInRect(ref Rects, Cursor.Position)))
                {
                    Top = 2 - Height;
                }
            }
            g = Mini_Artist_Label.CreateGraphics();
            if (g.MeasureString(Artist, Mini_Artist_Label.Font).Width > Mini_Artist_Label.Width)
            {
                Mini_Artist_Label.Refresh();
                s = g.MeasureString(Artist, Mini_Artist_Label.Font); //测量文字长度
                if (tempA != Artist)                                 //文字改变时,重新显示
                {
                    pA    = new PointF(Mini_Artist_Label.Size.Width, 0);
                    tempA = Artist;
                }
                else
                {
                    pA = new PointF(pA.X - 10, 0);//每次偏移10
                }
                if (pA.X <= -s.Width)
                {
                    pA = new PointF(Mini_Artist_Label.Size.Width, 0);
                }
                g.DrawString(Artist, Mini_Artist_Label.Font, brush, pA);
            }
            else
            {
                Mini_Artist_Label.Text = Artist;
            }
            g = Mini_Title_Label.CreateGraphics();
            if (g.MeasureString(Title, Mini_Title_Label.Font).Width > Mini_Title_Label.Width)
            {
                Mini_Title_Label.Refresh();
                s = g.MeasureString(Title, Mini_Title_Label.Font); //测量文字长度
                if (tempB != Title)                                //文字改变时,重新显示
                {
                    pB    = new PointF(Mini_Title_Label.Size.Width, 0);
                    tempB = Title;
                }
                else
                {
                    pB = new PointF(pB.X - 10, 0);//每次偏移10
                }
                if (pB.X <= -s.Width)
                {
                    pB = new PointF(Mini_Title_Label.Size.Width, 0);
                }
                g.DrawString(Title, Mini_Title_Label.Font, brush, pB);
            }
            else
            {
                Mini_Title_Label.Text = Title;
            }
        }