Public Const DIB_RGB_COLORS = 0& 'color table in RGBs
Public Type BITMAPINFOHEADER '40 bytes
biSize As Long
biWidth As Long
biHeight As Long
biPlanes As Integer
biBitCount As Integer
biCompression As Long
biSizeImage As Long
biXPelsPerMeter As Long
biYPelsPerMeter As Long
biClrUsed As Long
biClrImportant As Long
End Type
Public Type RGBQUAD
rgbBlue As Byte
rgbGreen As Byte
rgbRed As Byte
rgbReserved As Byte
End Type
Public Type BITMAPINFO
bmiHeader As BITMAPINFOHEADER
bmiColors(255) As RGBQUAD
End Type
Public Declare Function SetDIBitsToDevice Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal dx As Long, ByVal dy As Long, ByVal SrcX As Long, ByVal SrcY As Long, ByVal Scan As Long, ByVal NumScans As Long, Bits As Any, BitsInfo As BITMAPINFO, ByVal wUsage As Long) As Long
Public SPECWIDTH As Long 'display width
Public SPECHEIGHT As Long 'height (changing requires palette adjustments too)
Public specmode As Boolean, specpos As Integer ' spectrum mode (and marker pos for 2nd mode)
Public specbuf() As Byte 'a pointer
Public chan As Long 'recording channel
Public bh As BITMAPINFO 'bitmap header
Public Function Sqrt(ByVal num As Double) As Double
Sqrt = num ^ 0.5
End Function
'update the spectrum display - the interesting bit :)