Delphi-Quellcode:
procedure TfrmMain.lbListDblClick(Sender: TObject);
begin
xiPlayClick(Sender);
end;
In xiPlay.Click werden die Endungen geprüft: Wenn Video dann öffne Videofenster, geb Filtergraph frei, lade das neue Video und spiel es ab.
Mit MouseUp komm ich da nicht weiter.
frmVideo:
Delphi-Quellcode:
procedure TfrmVideo.FormDestroy(Sender: TObject);
begin
FilterGraph.ClearGraph;
FilterGraph.Free;
VideoWindow.Free;
frmMain.FGC := True;
end;
frmMain:
Delphi-Quellcode:
procedure TfrmMain.xiPlayClick(Sender: TObject);
var s : String;
begin
if (lbList.ItemIndex >= 0) then
begin
playindex := lbList.ItemIndex;
if LowerCase(ExtractFileExt(fFiles[playindex].Dateiname)) = '.mp3' then
begin
PlayFile(playindex);
with fFiles[playindex] do
begin
s := Artist + ' - ' + Titel + ' [' + trim(DurationMinSec(IntToStr(GetSongLength))) + ']';
lLauftext.Text := s;
lLauftext.Active := True;
lLauftext.Transparent := True;
Application.Title := s;
end;
pindex := playindex;
pause := True;
end;
if LowerCase(ExtractFileExt(fFiles[playindex].Dateiname)) = '.wmv' then
begin
frmVideo.Show;
xiStopClick(Sender);
with frmVideo do
begin
if not FilterGraph.Active then
begin
if not FilterGraph.Active then
FilterGraph.Active := True;
FilterGraph.ClearGraph;
FilterGraph.RenderFile(fFiles[playindex].pfad);
FilterGraph.play;
pause := True;
end;
end;
end;
if LowerCase(ExtractFileExt(fFiles[playindex].Dateiname)) = '.mpeg' then
begin
frmVideo.Show;
with frmVideo do
begin
if not FilterGraph.Active then
begin
if not FilterGraph.Active then
FilterGraph.Active := true;
FilterGraph.Stop;
FilterGraph.ClearGraph;
FilterGraph.RenderFile(fFiles[playindex].pfad);
FilterGraph.play;
pause := True;
end;
end;
end;
usw.
Das ist der Ursprungscode.