mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-02-02 06:17:34 +00:00
Smoother Audio Player progress bar
This commit is contained in:
parent
d4316e75fc
commit
99b438dd8f
1 changed files with 6 additions and 9 deletions
|
@ -58,7 +58,7 @@ namespace ShiftOS.WinForms.Applications
|
|||
|
||||
public void OnSkinLoad()
|
||||
{
|
||||
|
||||
pgplaytime.Width = flcontrols.Width - btnplay.Width - 25;
|
||||
}
|
||||
|
||||
public bool OnUnload()
|
||||
|
@ -151,17 +151,14 @@ namespace ShiftOS.WinForms.Applications
|
|||
pgplaytime.Maximum = (int)mp3.Length;
|
||||
new Thread(() =>
|
||||
{
|
||||
while(o.PlaybackState == NAudio.Wave.PlaybackState.Playing || o.PlaybackState == NAudio.Wave.PlaybackState.Paused)
|
||||
while (o.PlaybackState == NAudio.Wave.PlaybackState.Playing || o.PlaybackState == NAudio.Wave.PlaybackState.Paused)
|
||||
{
|
||||
long time = mp3.Position;
|
||||
if(time != mp3.Position)
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
time = mp3.Position;
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
pgplaytime.Value = (int)time;
|
||||
}));
|
||||
}
|
||||
pgplaytime.Value = (int)time;
|
||||
}));
|
||||
Thread.Sleep(50);
|
||||
}
|
||||
}).Start();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue