N
_nabuchodonozor
Hi, its me again
I'm writing my own mp3 player. I have loop which looks:
while (trackBar1.Value != TrackLength)
{
TrackBar1.Value = TrackPosition();
}
This loop set position to the TrackBar and when finishes a next track
is played from the palylist. Everything works correct but the loop
blocks whole program and I have to wait till it finishes. I cannot
change track when loop is working cuz program then not responding. I
thought that threads could help here. I create new Thread:
t1 = new Thread(new ThreadStart(Play)); where I put the method with
this loop. I set t1.isBackground = true; In method playAnotherSong() i
set t1.Abort(); but nothing has changed;/ I have to somehow break this
"while" if I want to play different song. What should I do??
I'm writing my own mp3 player. I have loop which looks:
while (trackBar1.Value != TrackLength)
{
TrackBar1.Value = TrackPosition();
}
This loop set position to the TrackBar and when finishes a next track
is played from the palylist. Everything works correct but the loop
blocks whole program and I have to wait till it finishes. I cannot
change track when loop is working cuz program then not responding. I
thought that threads could help here. I create new Thread:
t1 = new Thread(new ThreadStart(Play)); where I put the method with
this loop. I set t1.isBackground = true; In method playAnotherSong() i
set t1.Abort(); but nothing has changed;/ I have to somehow break this
"while" if I want to play different song. What should I do??