Цитата: if MediaPlayer1.Mode=mpPlaying then
begin
Inc(pls.i);
Form2.PlayMass(pls.i);
end;
есть подозрение что вот здесь глюк.
в общем ломало разбираться что там глючит, вот рабочий пример
[more]
private
{ Private declarations }
I:INTEGER;
procedure PlayMass(Ind:integer);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.PlayMass(Ind:integer);
begin
if ListBox1.Items.Count>=Ind then
with Form1.MediaPlayer1 do begin
Notify:=false;
if ind<ListBox1.Items.Count then Filename:=ListBox1.Items.Strings[Ind];
Open;Play;Notify:=true;
end;
Form1.Caption:=ExtractFileName(Form1.MediaPlayer1.FileName)+' - Media Player';
Application.Title:=ExtractFileName(Form1.MediaPlayer1.FileName)+' - Media Player';
end;
procedure TForm1.Button1Click(Sender: TObject);
var s: string;
koldir, kols, kolss, j: integer;
nam, str, cDir: string;
begin
if OpenDialog1.Execute then
begin
GetDir(0, cDir);
koldir := length(cdir);
for j:=0 to OpenDialog1.Files.Count-1 do
begin
kols := length(OpenDialog1.Files.Strings[j]);
ListBox1.Items.Add(OpenDialog1.Files.Strings[j]);
nam := Copy(OpenDialog1.Files.Strings[j], koldir+2, kols-koldir);
end;
end;
i:=0;
PlayMass(i);
end;
procedure TForm1.MediaPlayer1Notify(Sender: TObject);
begin
if MediaPlayer1.Mode=mpPlaying then
begin
Inc(i);
Form1.PlayMass(i);
end;
end;
[/more]
играют по очереди как в списке (добавляются только полные пути файлов, сами имена файлов нет). Проверь и потом от этого отталкивайся