SetLength(Buffer, BUFFER_SIZE);
ColumnCounter := 0;
start := GetTickCount;
if RadioButton1.Checked
then
begin
SetLength(ScanLines, Bitmap.Height);
for i := 0
to Length(ScanLines) - 1
do
ScanLines[i] := Bitmap.Scanline[i];
end;
while BASS_ChannelIsActive(Channel) <> BASS_ACTIVE_STOPPED
do
begin
BASS_ChannelGetData(Channel, Pointer(Buffer), BASS_DATA_FFT512);
for i := 0
to BUFFER_SIZE - 1
do
begin
Value := SQRT(SQRT(Buffer[i]));
H := 0 + Value / 1.5;
L := Value;
if RadioButton1.Checked
then
begin
P := ScanLines[BUFFER_SIZE - i];
HSLtoRGB(H, S, L, P^.rgbtRed, P^.rgbtGreen, P^.rgbtBlue);
end
else
begin
HSLtoRGB(H, S, L, R, G, B);
Bitmap.Canvas.Pixels[ColumnCounter, BUFFER_SIZE - i] :=
RGB(R, G, B)
end;
end;
if RadioButton1.Checked
then
begin
for i := 0
to Length(ScanLines) - 1
do
Inc(ScanLines[i]);
end
else
Inc(ColumnCounter);
Progress := trunc(100 * (Bass_ChannelGetPosition(Channel, BASS_POS_BYTE) / BASS_ChannelGetLength
(Channel, BASS_POS_BYTE)));
if (Form2.ProgressBar1.position <> Progress)
then
begin
Form2.ProgressBar1.position := Progress;
PB.Refresh;
end;
end;