private void timer1_Tick(object sender, EventArgs e) { int dur = (int)MediaPlayer1.Duration_Time(); TimeSpan spanDur = new TimeSpan(0, 0, 0, 0, dur); lbDuration.Text = FormatTime(spanDur); tbTimeline.Maximum = dur / 1000; TimeSpan spanPos; int pos = (int)MediaPlayer1.Position_Get_Time(); if (pos < dur) { spanPos = new TimeSpan(0, 0, 0, 0, pos); tbTimeline.Value = pos / 1000; } else { spanPos = new TimeSpan(0, 0, 0, 0, dur); tbTimeline.Value = dur / 1000; } lbPostion.Text = FormatTime(spanPos); }
private void timer1_Tick(object sender, EventArgs e) { timer1.Tag = 1; tbTimeline.Maximum = (int)(MediaPlayer1.Duration_Time() / 1000.0); int value = (int)(MediaPlayer1.Position_Get_Time() / 1000.0); if ((value > 0) && (value < tbTimeline.Maximum)) { tbTimeline.Value = value; } lbTime.Text = MediaPlayer.Helpful_SecondsToTimeFormatted(tbTimeline.Value) + "/" + MediaPlayer.Helpful_SecondsToTimeFormatted(tbTimeline.Maximum); timer1.Tag = 0; }
private void timer1_Tick(object sender, EventArgs e) { timer1.Tag = 1; tbTimeline.Maximum = (int)MediaPlayer1.Duration_Time().TotalSeconds; int value = (int)MediaPlayer1.Position_Get_Time().TotalSeconds; if ((value > 0) && (value < tbTimeline.Maximum)) { tbTimeline.Value = value; } lbTime.Text = MediaPlayer.Helpful_SecondsToTimeFormatted(tbTimeline.Value) + "/" + MediaPlayer.Helpful_SecondsToTimeFormatted(tbTimeline.Maximum); if (cbDVDControlChapter.Items.Count > 0) { if (MediaPlayer1.DVD_Chapter_GetCurrent() != cbDVDControlChapter.SelectedIndex) { cbDVDControlChapter.SelectedIndex = MediaPlayer1.DVD_Chapter_GetCurrent(); } } timer1.Tag = 0; }
private void timer1_Tick(object sender, EventArgs e) { var spanDur = MediaPlayer1.Duration_Time(); lbDuration.Text = FormatTime(spanDur); tbTimeline.Maximum = (int)spanDur.TotalSeconds; TimeSpan spanPos; var pos = MediaPlayer1.Position_Get_Time(); if (pos < spanDur) { spanPos = pos; tbTimeline.Value = (int)pos.TotalSeconds; } else { spanPos = spanDur; tbTimeline.Value = (int)spanDur.TotalSeconds; } lbPostion.Text = FormatTime(spanPos); }