So, hier ist die Source für meinen Play-Button und meinen Öffnen-Button;
Play-Button:
Delphi-Quellcode:
procedure TForm1.Play1Click(Sender: TObject);
begin
If Mediaplayer1.Mode = mpOpen then
Mediaplayer1.close;
Mediaplayer1.FileName := PlayList1.Items.Strings[PlayList1.ItemIndex];
SongPanel.Caption := Mediaplayer1.FileName;
SongPanel.Width :=
Mediaplayer1.Open;
Mediaplayer1.Play;
Timer1.Enabled := True;
begin
Mediaplayer1.Open;
Mediaplayer1.Play;
Mediaplayer1.FileName := FileLoad1.FileName;
Timer1.Enabled := True;
end;
end;
Öffnen-Button:
Delphi-Quellcode:
procedure TForm1.dateioeffnen1Click(Sender: TObject);
begin
with fileLoad1 do begin
Filter := 'Mp3-Files(*.mp3)|*.mp3|Wav-Files(*.wav)|*.wav|MIDI-Files(*.mid)|*.mid';
end;
if fileLoad1.Execute then
begin
mediaplayer1.FileName := fileLoad1.FileName;
SongPanel.Caption := mediaplayer1.FileName;
mediaplayer1.open;
mediaplayer1.Play;
Stunden:=0;
Minuten:=0;
Sekunden:=0;
Timer1.Enabled := True;
end;
end;
Gruss
DelphiUser7