Here's the VB6 code I use in my prototype app to show volume levels and current volume setting.
This is drawn directly on the form and scaled to the current volume level (tracked in a configuration class called settings).
Sub DoVolumeLevel()
On Local Error Resume Next
Dim L As Integer
Dim R As Integer
Dim Level As Long
Level = BASS_ChannelGetLevel(lng_BASSChannel)
L = (LoWord(Level) * (Settings.VolumeLevel * 0.01)) * (0.8)
R = (HiWord(Level) * (Settings.VolumeLevel * 0.01)) * (0.8)
If L > 100 Then L = 11
If R > 100 Then R = 11
Line (62, 4)-(62 + (L * 0.5), 6), RGB(0, 128, 0), BF
Line -(63 + (L * 0.5), 4), RGB(0, 255, 0), BF
If L < 99 Then Line (64 + (L * 0.5), 4)-(113, 6), 0, BF
Line (62, 7)-(62 + (Settings.VolumeLevel * 0.5), 9), RGB(0, 0, 128), BF
Line -(63 + (Settings.VolumeLevel * 0.5), 7), RGB(0, 0, 255), BF
If Settings.VolumeLevel < 99 Then Line (64 + (Settings.VolumeLevel * 0.5), 7)-(113, 9), 0, BF
Line (62, 10)-(62 + (R * 0.5), 12), RGB(0, 128, 0), BF
Line -(63 + (R * 0.5), 10), RGB(0, 255, 0), BF
If R < 99 Then Line (64 + (R * 0.5), 10)-(113, 12), 0, BF
End Sub
The " * (Settings.VolumeLevel * 0.01) " in the call scales the line length against the volume setting level. Dump that to have it not scale against your current volume setting.
The 0.8 scaling is used because the levels are returned as 0 to 128 and I want them to scale to 100. Then we multiply by .5 to get it fit in a 50 (not 128) pixel space. Remove the R an L multipliers if you want a full 100 pixel graph.
The form ScaleMode is 3 (pixel). Background color is black.
I have a timer that fires every 250 milliseconds that calls this Sub to update the display.
Enjoy!
-gogman-
Note: Sorry for the edits, I had to clear up what is going on there, it's late, I am tired.