Erschrick mich nich so, TBassDLLPlayer macht Fehler ?
Delphi-Quellcode:
procedure TForm1.Timer2Timer(Sender: TObject);
var
data: TFFTData;
begin
IF BassdllPlayer1.status = sndPLAYING then
begin
data := BassdllPlayer1.GetFFTData;
if Data[1] > max then
begin
Max := Data[1];
p.Width := Round(max);
end;
// <--- da wäre es besser
end;
if Data[1] > max then // <--- ab hier Fehler
begin
Max := Data[1];
ProgressBar1.Max := Round(max);
end;
ProgressBar1.Position := Round(Data[1]);
end;
Oder so....
Delphi-Quellcode:
procedure TForm1.Timer2Timer(Sender: TObject);
var
data: TFFTData;
begin
if BassdllPlayer1.status <> sndPLAYING then exit;
data := BassdllPlayer1.GetFFTData;
if Data[1] > max then
begin
Max := Data[1];
p.Width := Round(max);
end;
if Data[1] > max then
begin
Max := Data[1];
ProgressBar1.Max := Round(max);
end;
ProgressBar1.Position := Round(Data[1]);
end;