Skip to content

Commit 7e41281

Browse files
committed
- Reworked UpdateProgressBar() logic.
1 parent 8d67774 commit 7e41281

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/view/Tui.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,16 +361,15 @@ private void UpdateProgressBar()
361361
{
362362
this.mainLoopTimeout = Application.MainLoop.AddTimeout(TimeSpan.FromSeconds(1), (updateTimer) =>
363363
{
364-
while (this.player.CurrentTime().Seconds < this.player.TrackLength().TotalSeconds && this.player.PlayerStatus != PlayerStatus.Stopped)
364+
while (this.player.CurrentTime().Seconds < this.player.TrackLength().TotalSeconds && this.player.PlayerStatus is not PlayerStatus.Stopped)
365365
{
366-
// this.AudioProgressBar.Fraction += (float)(1 / this.player.CurrentTime().TotalSeconds);
367-
this.AudioProgressBar.Pulse();
366+
this.AudioProgressBar.Fraction = (float)(this.player.CurrentTime().Seconds / this.player.TrackLength().TotalSeconds);
368367
this.TimePlayedLabel();
369368

370369
return true;
371370
}
372371

373-
return true;
372+
return false;
374373
});
375374
}
376375
}

0 commit comments

Comments
 (0)