delphi播放器中的列表循环播放

来源:百度知道 编辑:UC知道 时间:2024/05/10 16:54:26
delphi中怎么使播放器中的歌曲循环播放呀。我只能循环1首歌就停下了。
对不起,我是初学者,你那代码我看不懂,你看下我的吧!
if N14.Checked=True
then
begin
if fllst1.ItemIndex=fllst1.Count-1
then
begin
fllst1.ItemIndex:=-1;
n17.Click;
end
else
begin
fllst1.ItemIndex:=fllst1.ItemIndex+1;
fllst1.FileName:=fllst1.Items[fllst1.Itemindex];
mp1.Open;
mp1.Position:=0;
mp1.Play;
end;
end;

这怎么播放不起呀。
啊!知道了,太不小心了。
fllst1.FileName:=fllst1.Items[fllst1.Itemindex];错了
应该是
mp1.FileName:=fllst1.Items[fllst1.Itemindex];
还有听说可以在mp1的OnNotify事件上写。但是我只能循环播放一首mp3,这是为什么呀。
回答满意的话加30分。麻烦大家了

function FileList(Path: string; Attr: Integer = FAAnyfile): TStrings;
var
SR: TSearchRec;
begin
Result := TStringList.Create;
if Path[Length(Path)] <> '\' then
Path := Path + '\';
if (Attr and FADirectory) <> FADirectory then
Attr := Attr or FADirectory;
if FindFirst(Path + '*.*', Attr, SR) = 0 then
repeat
if (SR.Attr and FADirectory) = FADirectory then begin
if (SR.Name <> '.') and (SR.Name <> '..') then
Result.AddStrings(FileList(Path + SR.Name));
end
else
Result.Add(Path + SR.Name);
until FindNext(SR) <> 0;
FindClose(SR);
end;