你帮我看一下如下代码有没有错:
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if (mpegplayer1.Mode=3) then
begin
progressbar1.Position:=MPEGPlayer1.CurrentPosition;
end;
if mpegplayer1.PlayStopped then
begin
if XP_CheckBox1.Checked then //单曲播放
begin
mpegplayer1.Play;
end
else
if XP_CheckBox2.Checked then //循环播放
begin
filelistbox1.ItemIndex:=filelistbox1.ItemIndex+1;
MPEGPlayer1.StreamName:=Filelistbox1.FileName;
MPEGPlayer1.Open;
Progressbar1.Position:=0;
ProgressBar1.Max:=MPEGPlayer1.length;
MPEGPlayer1.Play;
end;
end;
end;
加一个 Mpepplayer1.close;
if XP_CheckBox1.Checked then //单曲播放
begin
mpegplayer1.Play;
end
else
if XP_CheckBox2.Checked then //循环播放
begin
filelistbox1.ItemIndex:=filelistbox1.ItemIndex+1;
MPEGPlayer1.StreamName:=Filelistbox1.FileName;
MPEGPlayer1.Open;
Progressbar1.Position:=0;
ProgressBar1.Max:=MPEGPlayer1.length;
MPEGPlayer1.Play;
end;