procedure TMainApp.RenderSpectragram(position: QWORD; Y: integer; cl: TColor);
var
Graphics: Cardinal;
sectime: integer;
str: string;
rc: TRect;
X: integer;
begin
sectime := trunc(Bass_ChannelBytes2Seconds(Channel, position));
//Zeit Formatieren
str := '';
if (sectime mod 60 < 10) then
str := '0';
str := str + IntToStr(sectime mod 60);
str := IntToStr(sectime div 60) + ':' + str;
SKAERO_SetCTLText(lblTime.handle, PWideChar('Time: ' + BassAudioToTime(BassChannelGetPos)
+ ' / ' + BassAudioToTime(1000 * Bass_ChannelBytes2Seconds(Channel, Bass_ChannelGetLength
(Channel, 0)))));
GetClientRect(RenderFrameHandle, rc);
// Render
if GDIP_CreateFromHDC(PaintDC, Graphics) = 0 then
begin
X := position div bpp;
// xOffset inkrementieren
if X > xOffset then
begin
GDIP_FillRect(Graphics, 0, 0, rc.Right, rc.Bottom, SKAERO_ColorARGB(255, 0));
xOffset := xOffset + BackSpectraWinFrame.Width;
HScroll.Value := X;
if xOffset > BuffBMP.Width then
begin
GDIP_FillRect(Graphics, 0, 0, rc.Right, rc.Bottom, SKAERO_ColorARGB(255, 0));
xOffset := BuffBMP.Width;
HScroll.Value := X;
end;
end;
// Hintergrund löschen
GDIP_FillRect(Graphics, 0, 0, X + DrawTLWidth, rc.Bottom, SKAERO_ColorARGB(255, 0));
// Zeichnen
BitBlt(PaintDC, 0, 0, (XPos div integer(bpp)) + DrawTLWidth + BackSpectraWinFrame.Width,
rc.Bottom, BuffBMP.Canvas.handle, (xOffset - BackSpectraWinFrame.Width), 0, SRCPAINT);
// Linie überzeichnen
GDIP_DrawLine(Graphics, X - trunc(HScroll.Value), 0, X - trunc(HScroll.Value), BuffBMP.Height,
1, SKAERO_ColorARGB(255, cl));
// Zeitanzeige zeichnen
rc.Left := (X - trunc(HScroll.Value)) + 2;
rc.top := 0;
GDIP_DrawTextToDC(PaintDC, PWideChar(str), rc, SKAERO_ACTIVECAPTION, PWideChar(SKAERO_TEXTFONT)
, SKAERO_PUSHBUTFONTSIZE, FontStyleBoldItalic, 1.1, 0);
// Graphics löschen
GDIP_DeleteGraphics(Graphics);
end;
end;