Hier OSCDraw von turboPascal:
Delphi-Quellcode:
procedure TForm1.OscDraw(aBitmap: TBitmap; WaveData: TWaveData; ScopeOff: Word);
const
DrawRes = 2;
var
i, YPos: LongInt;
HalfHeight: Integer;
R, L: SmallInt;
begin
with aBitmap do
begin
Assign(HintergrundBitmap);
HalfHeight := Height div 2;
Canvas.Pen.Width := 1;
Canvas.Pen.Color := clYellow;
Canvas.moveto(0, HalfHeight div 2);
for i := 0 to 255 do
begin
R := SmallInt(Loword(WaveData[i * DrawRes])); // Rechter Kanal
YPos := Trunc((R / (2 * 65535)) * ScopeOff);
Canvas.lineto(i, HalfHeight div 2 + YPos);
end;
Canvas.moveto(0, HalfHeight + (HalfHeight div 2));
for i := 0 to 255 do
begin
L := SmallInt(HiWord(WaveData[i * DrawRes])); // Linker Kanal
YPos := Trunc((L / (2 * 65535)) * ScopeOff);
Canvas.lineto(i, HalfHeight + (HalfHeight div 2) + YPos);
end;
Canvas.Pen.Color := clRed;
Canvas.Pen.Width := 2;
Canvas.moveto(0, HalfHeight);
for i := 0 to 255 do
begin
R := SmallInt(Loword(WaveData[i * DrawRes]));
L := SmallInt(HiWord(WaveData[i * DrawRes]));
YPos := Trunc(((R + L) / (2 * 65535)) * ScopeOff); // Beide Kanäle
Canvas.lineto(i, HalfHeight + YPos);
end;
end;
end;
Und hier die Scrollschrift von mir:
Delphi-Quellcode:
procedure TForm1.ScrollTimerTimer(Sender: TObject);
var
I:Integer;
S,ScrollText:String;
Begin
ScrollText:=' Multimediaplayer Version 1.5 ';
Inc(Scroll);
If Scroll>Length(ScrollText)-21 then
Scroll :=0;
For I:=1 to 21 do
S:=S+ScrollText[I+Scroll];
Application.Title:=S;