コード例 #1
0
 private void UpdateMusicTrackBar()
 {
     if (playManager.PlaybackState == PlaybackState.Playing)
     {
         var currentPosition = playManager.CurrentTrackPosition.Value.TotalSeconds;
         var overallDuration = playManager.ActiveTrack.Duration.TotalSeconds;
         musicTrackBar.SetPointerAccordingToTrackPosition(currentPosition, overallDuration);
         CurrentPositionLabel.Text = $"{(int)currentPosition/60}m{(int)currentPosition%60}s/{(int)overallDuration/60}m{(int)overallDuration%60}s";
     }
     else if (playManager.PlaybackState != PlaybackState.Paused)
     {
         musicTrackBar.Pointer     = 0;
         CurrentPositionLabel.Text = "0m0s/0m0s";
     }
     TrackBarPictureBox.Refresh();
 }
コード例 #2
0
 private void TrackBarPictureBox_MouseUp(object sender, MouseEventArgs e)
 {
     musicTrackBar.MouseUp(e.X, e.Y, playManager);
     TrackBarPictureBox.Refresh();
 }
コード例 #3
0
 private void TrackBarPictureBox_Resize(object sender, EventArgs e)
 {
     musicTrackBar.Width  = TrackBarPictureBox.Width;
     musicTrackBar.Height = TrackBarPictureBox.Height;
     TrackBarPictureBox.Refresh();
 }