Ok, ist leider im Moment alle nocht nicht so elegant umgesetzt...
Delphi-Quellcode:
procedure TForm1.Spiel(dname: string); //Spielt Datei "dname" ab
begin
with MediaPlayer1 do
begin
If Mode = mpOpen then close;
FileName := dname;
if CheckBox1.Checked then Display:=Panel1
else Display := nil;
DisplayRect:=Panel1.ClientRect;
Open;
Play;
playing := true;
end;
end;
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject); //Dateiauswahl
begin
if opendialog1.Execute then
if (ExtractFileExt(Opendialog1.FileName) = '.m3u') then
begin
ListBox1.Items.LoadFromFile(Opendialog1.FileName);
ListBox1.Visible := true;
ShellTreeView1.Visible := false;
ListBox1.ItemIndex := 0;
spiel(listbox1.Items.Strings[listbox1.ItemIndex]);
MediaPlayer1.Notify := true;
playlist := true;
end
else Spiel(Opendialog1.FileName);
end;
Delphi-Quellcode:
Procedure TForm1.MediaPlayer1Notify(Sender: TObject);
var
a: integer;
begin
if NoNotify then
begin
NoNotify := false;
exit;
end
else
with listbox1 do
if (ItemIndex <= Count) and playlist then
begin
a := ItemIndex;
itemindex := a + 1;
Spiel(Items.Strings[ItemIndex]);
MediaPlayer1.Notify := true;
end;
end;
Delphi-Quellcode:
procedure TForm1.MediaPlayer1Click(Sender: TObject; Button: TMPBtnType;
var DoDefault: Boolean); //Abfrage der Button
var
a: integer;
begin
if (button = MPlayer.btNext) and playlist then
with listbox1 do
begin
NoNotify := true;
a := ItemIndex;
itemindex := a + 1;
Spiel(Items.Strings[ItemIndex]);
NoNotify := true;
end;
if (button = MPlayer.btPrev) and playlist then
with listbox1 do
begin
NoNotify := true;
a := ItemIndex;
itemindex := a - 1;
Spiel(Items.Strings[ItemIndex]);
NoNotify := true;
end;
end;
If there isn´t what you need, develop it...
(Und dazu brauche ich jetzt eure Hilfe!
)