fury
asked on
How to write an equalizer
I have a CD player program written. Users request me to add LED bars, you know, those graphical analyser, to the program. I'd like to know how I can do a Left/Right channel graphical analyser like
http://www.jps.net/sanctuary/dbmeter1.gif
That's all the points I got, sorry...
http://www.jps.net/sanctuary/dbmeter1.gif
That's all the points I got, sorry...
I have some tips on how to implement it on Win95 systems, not a complete code for it, but a little something that you could try if you'd like.
ASKER
Yes sure...please
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I am not sure if msiman's answer is good, so I'll wait and let you comment on it. It lets you retrieve the setting of the volume control.
ASKER
But when I play CD, the volume LED bar at the WAV section of the volume control display nothing.
does CD audio output as WAVE?
does CD audio output as WAVE?
yeah, i think y96xxx is right.... the volume stays the
same... sorry, please reject my answer,
i m very sorry for locking the question...
MSIMAN
same... sorry, please reject my answer,
i m very sorry for locking the question...
MSIMAN
CD-audio doesn't output as wave. There are two ways to do this: If you are lucky, the sound card might have a built-in meter for the output level from the CD that you can read and display. Otherwise you have to sample the data in short intervals and calculate an averaged amplitude to display.
If there is a built-in meter, you can use a series of functions described in https://www.experts-exchange.com/topics/bin/ShowQ?qid=8630002206, whose solution I could post here.
If you need to sample data, you should use functions described in https://www.experts-exchange.com/topics/bin/Q.8630011161, unfortunately not completely solved yet, but I could post info on that one here too.
If there is a built-in meter, you can use a series of functions described in https://www.experts-exchange.com/topics/bin/ShowQ?qid=8630002206, whose solution I could post here.
If you need to sample data, you should use functions described in https://www.experts-exchange.com/topics/bin/Q.8630011161, unfortunately not completely solved yet, but I could post info on that one here too.
ASKER
I don't have much points..please post all u can. please...
I'll begin with how to read values from built-in meters. Try this code and see what info can be read from your sound card.
-------------------------- ---------- ---------- ---------- ---------- -------
VERSION 4.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 8115
ClientLeft = 585
ClientTop = 720
ClientWidth = 9990
Height = 8520
Left = 525
LinkTopic = "Form1"
ScaleHeight = 8115
ScaleWidth = 9990
Top = 375
Width = 10110
Begin VB.CommandButton Command1
Caption = "Update"
Height = 255
Left = 8280
TabIndex = 0
Top = 120
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
'
Private Sub Command1_Click()
Cls
Dim ml As MIXERLINE
Dim mcs As MIXERCAPS
Dim mlc As MIXERLINECONTROLS
Dim mc As MIXERCONTROL
Dim mcd As MIXERCONTROLDETAILS
Dim buf(4096) As Byte
mcsize = LenB(mc) '17 * 4 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS
Dim status As Long
For i = 0 To mixerGetNumDevs - 1
status = mixerGetDevCaps(i, mcs, LenB(mcs))
' Print "mixerGetDevCaps"; status
Print "mixer "; s(mcs.szPname)
For j = 0 To mcs.cDestinations - 1
ml.cbStruct = LenB(ml)
ml.dwDestination = j
ml.dwSource = 0
status = mixerGetLineInfo(i, ml, MIXER_GETLINEINFOF_DESTINA TION)
' Print " mixerGetLineInfo "; status
Print " destination line "; s(ml.szShortName); " = '"; s(ml.szName); "', controls: "; ml.cControls; ", connections: "; ml.cConnections
mlc.cbStruct = LenB(mlc)
mlc.dwLineID = ml.dwLineID
mlc.cControls = ml.cControls
mlc.cbmxctrl = LenB(mc)
mlc.pamxctrl = String(LenB(mc) * ml.cControls, 0)
status = mixerGetLineControls(i, mlc, MIXER_GETLINECONTROLSF_ALL )
' Print " mixerGetLineControls "; status
For k = 0 To ml.cControls - 1
mc.dwControlID = tolong(Mid$(mlc.pamxctrl, k * mcsize + 1 + 4))
mc.dwControlType = tolong(Mid$(mlc.pamxctrl, k * mcsize + 1 + 2 * 4))
mc.szShortName = Mid$(mlc.pamxctrl, k * mcsize + 1 + 5 * 4, MIXER_SHORT_NAME_CHARS)
mc.szName = Mid$(mlc.pamxctrl, k * mcsize + 1 + 5 * 4 + MIXER_SHORT_NAME_CHARS, MIXER_LONG_NAME_CHARS)
' Print mc.szShortName
' Print mc.szName
' Print hex$(mc.dwControlID)
' Print hex$(mc.dwControlType)
Print " control "; s(mc.szShortName); " = '"; s(mc.szName); "', ";
Print "parsed type=[";
If mc.fdwControl & MIXERCONTROL_CONTROLF_UNIF ORM Then
Print "Uniform ";
End If
Select Case (mc.dwControlType And MIXERCONTROL_CT_CLASS_MASK )
Case MIXERCONTROL_CT_CLASS_CUST OM
Print "Custom ";
Case MIXERCONTROL_CT_CLASS_FADE R
Print "Fader ";
Case MIXERCONTROL_CT_CLASS_LIST
Print "List ";
Case MIXERCONTROL_CT_CLASS_METE R
Print "Meter ";
Case MIXERCONTROL_CT_CLASS_NUMB ER
Print "Number ";
Case MIXERCONTROL_CT_CLASS_SLID ER
Print "Slider ";
Case MIXERCONTROL_CT_CLASS_SWIT CH
Print "Switch ";
Case MIXERCONTROL_CT_CLASS_TIME
Print "Time ";
Case Else
Print "Unknown ("; hex$(mc.dwControlType And MIXERCONTROL_CT_CLASS_MASK ); ") "
End Select
Select Case mc.dwControlType
Case MIXERCONTROL_CONTROLTYPE_M IXER
Print "Mixer ";
Case MIXERCONTROL_CONTROLTYPE_M UX
Print "Mux ";
Case MIXERCONTROL_CONTROLTYPE_P EAKMETER
Print "PeakMeter ";
mcd.cbStruct = Len(mcd)
mcd.dwControlID = mc.dwControlID
If mc.fdwControl & MIXERCONTROL_CONTROLF_UNIF ORM Then
mcd.cChannels = 1
Else
mcd.cChannels = ml.cChannels
End If
mcd.cbDetails = 4
mcd.item = 0
mcd.paDetails = String(4 * mcd.cChannels, 0)
status = mixerGetControlDetails(i, mcd, MIXER_GETCONTROLDETAILSF_V ALUE)
For m = 1 To mcd.cChannels
Print "peak["; m; "]="; tolong(Mid$(mcd.paDetails, m * 4 - 3)); " ";
Next m
Case MIXERCONTROL_CONTROLTYPE_O NOFF
Print "OnOff ";
Case MIXERCONTROL_CONTROLTYPE_M UTE
Print "Mute ";
Case MIXERCONTROL_CONTROLTYPE_M ONO
Print "Mono ";
Case MIXERCONTROL_CONTROLTYPE_L OUDNESS
Print "Loudness ";
Case MIXERCONTROL_CONTROLTYPE_S TEREOENH
Print "StereoEnh ";
Case MIXERCONTROL_CONTROLTYPE_V OLUME
Print "Volume ";
Case MIXERCONTROL_CONTROLTYPE_B ASS
Print "Bass ";
Case MIXERCONTROL_CONTROLTYPE_T REBLE
Print "Treble ";
Case MIXERCONTROL_CONTROLTYPE_E QUALIZER
Print "Equalizer ";
Case MIXERCONTROL_CONTROLTYPE_P AN
Print "Pan ";
Case MIXERCONTROL_CONTROLTYPE_Q SOUNDPAN
Print "QSoundPan ";
End Select
Print "]"
Next k
For l = 0 To ml.cConnections - 1
ml.dwSource = l
status = mixerGetLineInfo(i, ml, MIXER_GETLINEINFOF_SOURCE)
' Print " mixerGetLineInfo "; status
Print " source line "; s(ml.szShortName); " = '"; s(ml.szName); "', channels: "; ml.cChannels; ", controls: "; ml.cControls
mlc.cbStruct = Len(mlc)
mlc.dwLineID = ml.dwLineID
mlc.cControls = ml.cControls
mlc.cbmxctrl = LenB(mc)
mlc.pamxctrl = String(LenB(mc) * ml.cControls, 0)
status = mixerGetLineControls(i, mlc, MIXER_GETLINECONTROLSF_ALL )
' Print " mixerGetLineControls "; status
For k = 0 To ml.cControls - 1
mc.dwControlID = tolong(Mid$(mlc.pamxctrl, k * mcsize + 1 + 4))
mc.dwControlType = tolong(Mid$(mlc.pamxctrl, k * mcsize + 1 + 2 * 4))
mc.fdwControl = tolong(Mid$(mlc.pamxctrl, k * mcsize + 1 + 3 * 4))
mc.szShortName = Mid$(mlc.pamxctrl, k * mcsize + 1 + 5 * 4, MIXER_SHORT_NAME_CHARS)
mc.szName = Mid$(mlc.pamxctrl, k * mcsize + 1 + 5 * 4 + MIXER_SHORT_NAME_CHARS, MIXER_LONG_NAME_CHARS)
' Print mc.szShortName
' Print mc.szName
' Print hex$(mc.dwControlID)
' Print hex$(mc.dwControlType)
Print " control "; s(mc.szShortName); " = '"; s(mc.szName); "', ";
Print "parsed type=[";
If mc.fdwControl & MIXERCONTROL_CONTROLF_UNIF ORM Then
Print "Uniform ";
End If
Select Case (mc.dwControlType And MIXERCONTROL_CT_CLASS_MASK )
Case MIXERCONTROL_CT_CLASS_CUST OM
Print "Custom ";
Case MIXERCONTROL_CT_CLASS_FADE R
Print "Fader ";
Case MIXERCONTROL_CT_CLASS_LIST
Print "List ";
Case MIXERCONTROL_CT_CLASS_METE R
Print "Meter ";
Case MIXERCONTROL_CT_CLASS_NUMB ER
Print "Number ";
Case MIXERCONTROL_CT_CLASS_SLID ER
Print "Slider ";
Case MIXERCONTROL_CT_CLASS_SWIT CH
Print "Switch ";
Case MIXERCONTROL_CT_CLASS_TIME
Print "Time ";
Case Else
Print "Unknown ("; hex$(mc.dwControlType And MIXERCONTROL_CT_CLASS_MASK ); ") "
End Select
Select Case mc.dwControlType
Case MIXERCONTROL_CONTROLTYPE_M IXER
Print "Mixer ";
Case MIXERCONTROL_CONTROLTYPE_M UX
Print "Mux ";
Case MIXERCONTROL_CONTROLTYPE_P EAKMETER
Print "PeakMeter ";
mcd.cbStruct = Len(mcd)
mcd.dwControlID = mc.dwControlID
If mc.fdwControl & MIXERCONTROL_CONTROLF_UNIF ORM Then
mcd.cChannels = 1
Else
mcd.cChannels = ml.cChannels
End If
mcd.cbDetails = 4
mcd.item = 0
mcd.paDetails = String(4 * mcd.cChannels, 0)
status = mixerGetControlDetails(i, mcd, MIXER_GETCONTROLDETAILSF_V ALUE)
For m = 1 To mcd.cChannels
Print "peak["; m; "]="; tolong(Mid$(mcd.paDetails, m * 4 - 3)); " ";
Next m
Case MIXERCONTROL_CONTROLTYPE_O NOFF
Print "OnOff ";
Case MIXERCONTROL_CONTROLTYPE_M UTE
Print "Mute ";
Case MIXERCONTROL_CONTROLTYPE_M ONO
Print "Mono ";
Case MIXERCONTROL_CONTROLTYPE_L OUDNESS
Print "Loudness ";
Case MIXERCONTROL_CONTROLTYPE_S TEREOENH
Print "StereoEnh ";
Case MIXERCONTROL_CONTROLTYPE_V OLUME
Print "Volume ";
Case MIXERCONTROL_CONTROLTYPE_B ASS
Print "Bass ";
Case MIXERCONTROL_CONTROLTYPE_T REBLE
Print "Treble ";
Case MIXERCONTROL_CONTROLTYPE_E QUALIZER
Print "Equalizer ";
Case MIXERCONTROL_CONTROLTYPE_P AN
Print "Pan ";
Case MIXERCONTROL_CONTROLTYPE_Q SOUNDPAN
Print "QSoundPan ";
End Select
Print "]"
Next k
Next l
Next j
Next i
End Sub
-------------------------- ---------- ---------- ---------- ---------- -------
Attribute VB_Name = "Module1"
Public Const MIXER_LONG_NAME_CHARS = 64
Public Const MIXER_SHORT_NAME_CHARS = 16
Public Const MAXPNAMELEN = 32 ' max product name length (including NULL)
Declare Function waveOutGetNumDevs Lib "winmm.dll" () As Long
Declare Function mixerOpen Lib "winmm.dll" (phmx As Long, ByVal uMxId As Long, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal fdwOpen As Long) As Long
Declare Function mixerClose Lib "winmm.dll" (ByVal hmx As Long) As Long
Declare Function mixerGetControlDetails Lib "winmm.dll" Alias "mixerGetControlDetailsA" (ByVal hmxobj As Long, pmxcd As MIXERCONTROLDETAILS, ByVal fdwDetails As Long) As Long
Declare Function mixerGetLineControls Lib "winmm.dll" Alias "mixerGetLineControlsA" (ByVal hmxobj As Long, pmxlc As MIXERLINECONTROLS, ByVal fdwControls As Long) As Long
Declare Function mixerGetDevCaps Lib "winmm.dll" Alias "mixerGetDevCapsA" (ByVal uMxId As Long, pmxcaps As MIXERCAPS, ByVal cbmxcaps As Long) As Long
Declare Function mixerGetID Lib "winmm.dll" (ByVal hmxobj As Long, pumxID As Long, ByVal fdwId As Long) As Long
Declare Function mixerGetLineInfo Lib "winmm.dll" Alias "mixerGetLineInfoA" (ByVal hmxobj As Long, pmxl As MIXERLINE, ByVal fdwInfo As Long) As Long
Declare Function mixerGetNumDevs Lib "winmm.dll" () As Long
Type MIXERCAPS
wMid As Integer ' manufacturer id
wPid As Integer ' product id
vDriverVersion As Long ' version of the driver
szPname As String * MAXPNAMELEN ' product name
fdwSupport As Long ' misc. support bits
cDestinations As Long ' count of destinations
End Type
Type MIXERCONTROL
cbStruct As Long ' size in Byte of MIXERCONTROL
dwControlID As Long ' unique control id for mixer device
dwControlType As Long ' MIXERCONTROL_CONTROLTYPE_x xx
fdwControl As Long ' MIXERCONTROL_CONTROLF_xxx
cMultipleItems As Long ' if MIXERCONTROL_CONTROLF_MULT IPLE set
szShortName As String * MIXER_SHORT_NAME_CHARS
szName As String * MIXER_LONG_NAME_CHARS
Bounds1 As Long
Bounds2 As Long
Bounds3 As Long
Bounds4 As Long
Bounds5 As Long
Bounds6 As Long
Metrics1 As Long
Metrics2 As Long
Metrics3 As Long
Metrics4 As Long
Metrics5 As Long
Metrics6 As Long
End Type
Type MIXERCONTROLDETAILS
cbStruct As Long ' size in Byte of MIXERCONTROLDETAILS
dwControlID As Long ' control id to get/set details on
cChannels As Long ' number of channels in paDetails array
item As Long ' hwndOwner or cMultipleItems
cbDetails As Long ' size of _one_ details_XX struct
paDetails As String 'Long ' pointer to array of details_XX structs
End Type
Type MIXERCONTROLDETAILS_BOOLEA N
fValue As Long
End Type
Type MIXERCONTROLDETAILS_LISTTE XT
dwParam1 As Long
dwParam2 As Long
szName As String * MIXER_LONG_NAME_CHARS
End Type
Type MIXERCONTROLDETAILS_SIGNED
lValue As Long
End Type
Type Target ' for use in MIXERLINE and others (embedded structure)
dwType As Long ' MIXERLINE_TARGETTYPE_xxxx
dwDeviceID As Long ' target device ID of device type
wMid As Integer ' of target device
wPid As Integer ' "
vDriverVersion As Long ' "
szPname As String * MAXPNAMELEN
End Type
Type MIXERCONTROLDETAILS_UNSIGN ED
dwValue As Long
End Type
Type MIXERLINE
cbStruct As Long ' size of MIXERLINE structure
dwDestination As Long ' zero based destination index
dwSource As Long ' zero based source index (if source)
dwLineID As Long ' unique line id for mixer device
fdwLine As Long ' state/information about line
dwUser As Long ' driver specific information
dwComponentType As Long ' component type line connects to
cChannels As Long ' number of channels line supports
cConnections As Long ' number of connections (possible)
cControls As Long ' number of controls at this line
szShortName As String * MIXER_SHORT_NAME_CHARS
szName As String * MIXER_LONG_NAME_CHARS
lpTarget As Target
End Type
Type MIXERLINECONTROLS
cbStruct As Long ' size in Byte of MIXERLINECONTROLS
dwLineID As Long ' line id (from MIXERLINE.dwLineID)
' MIXER_GETLINECONTROLSF_ONE BYID or
dwControl As Long ' MIXER_GETLINECONTROLSF_ONE BYTYPE
cControls As Long ' count of controls pmxctrl points to
cbmxctrl As Long ' size in Byte of _one_ MIXERCONTROL
pamxctrl As String 'MIXERCONTROL ' pointer to first MIXERCONTROL array
End Type
Type buf192
buf(192) As Byte
End Type
Public Const MIXER_GETCONTROLDETAILSF_L ISTTEXT = &H1&
Public Const MIXER_GETCONTROLDETAILSF_Q UERYMASK = &HF&
Public Const MIXER_GETCONTROLDETAILSF_V ALUE = &H0&
Public Const MIXER_GETLINECONTROLSF_ALL = &H0&
Public Const MIXER_GETLINECONTROLSF_ONE BYID = &H1&
Public Const MIXER_GETLINECONTROLSF_ONE BYTYPE = &H2&
Public Const MIXER_GETLINECONTROLSF_QUE RYMASK = &HF&
Public Const MIXER_GETLINEINFOF_COMPONE NTTYPE = &H3&
Public Const MIXER_GETLINEINFOF_DESTINA TION = &H0&
Public Const MIXER_GETLINEINFOF_LINEID = &H2&
Public Const MIXER_GETLINEINFOF_QUERYMA SK = &HF&
Public Const MIXER_GETLINEINFOF_SOURCE = &H1&
Public Const MIXER_GETLINEINFOF_TARGETT YPE = &H4&
Public Const MIXER_OBJECTF_AUX = &H50000000
Public Const MIXER_OBJECTF_HANDLE = &H80000000
Public Const MIXER_OBJECTF_MIDIIN = &H40000000
Public Const MIXER_OBJECTF_MIDIOUT = &H30000000
Public Const MIXER_OBJECTF_MIXER = &H0&
Public Const MIXER_OBJECTF_WAVEIN = &H20000000
Public Const MIXER_OBJECTF_WAVEOUT = &H10000000
Public Const MIXERCONTROL_CT_CLASS_CUST OM = &H0&
Public Const MIXERCONTROL_CT_CLASS_FADE R = &H50000000
Public Const MIXERCONTROL_CT_CLASS_LIST = &H70000000
Public Const MIXERCONTROL_CT_CLASS_MASK = &HF0000000
Public Const MIXERCONTROL_CT_CLASS_METE R = &H10000000
Public Const MIXERCONTROL_CT_CLASS_NUMB ER = &H30000000
Public Const MIXERCONTROL_CT_CLASS_SLID ER = &H40000000
Public Const MIXERCONTROL_CT_CLASS_SWIT CH = &H20000000
Public Const MIXERCONTROL_CT_CLASS_TIME = &H60000000
Public Const MIXERCONTROL_CT_SC_LIST_MU LTIPLE = &H1000000
Public Const MIXERCONTROL_CT_SC_LIST_SI NGLE = &H0&
Public Const MIXERCONTROL_CT_SC_METER_P OLLED = &H0&
Public Const MIXERCONTROL_CT_SC_SWITCH_ BOOLEAN = &H0&
Public Const MIXERCONTROL_CT_SC_SWITCH_ BUTTON = &H1000000
Public Const MIXERCONTROL_CT_SC_TIME_MI CROSECS = &H0&
Public Const MIXERCONTROL_CT_SC_TIME_MI LLISECS = &H1000000
Public Const MIXERCONTROL_CT_SUBCLASS_M ASK = &HF000000
Public Const MIXERCONTROL_CT_UNITS_BOOL EAN = &H10000
Public Const MIXERCONTROL_CT_UNITS_CUST OM = &H0&
Public Const MIXERCONTROL_CT_UNITS_DECI BELS = &H40000 ' in 10ths
Public Const MIXERCONTROL_CT_UNITS_MASK = &HFF0000
Public Const MIXERCONTROL_CT_UNITS_PERC ENT = &H50000 ' in 10ths
Public Const MIXERCONTROL_CT_UNITS_SIGN ED = &H20000
Public Const MIXERCONTROL_CT_UNITS_UNSI GNED = &H30000
Public Const MIXER_OBJECTF_HMIDIIN = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIIN)
Public Const MIXER_OBJECTF_HMIDIOUT = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIOUT)
Public Const MIXER_OBJECTF_HMIXER = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIXER)
Public Const MIXER_OBJECTF_HWAVEIN = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEIN)
Public Const MIXER_OBJECTF_HWAVEOUT = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEOUT)
Public Const MIXER_SETCONTROLDETAILSF_C USTOM = &H1&
Public Const MIXER_SETCONTROLDETAILSF_Q UERYMASK = &HF&
Public Const MIXER_SETCONTROLDETAILSF_V ALUE = &H0&
Public Const MIXERCONTROL_CONTROLF_DISA BLED = &H80000000
Public Const MIXERCONTROL_CONTROLF_MULT IPLE = &H2&
Public Const MIXERCONTROL_CONTROLF_UNIF ORM = &H1&
Public Const MIXERCONTROL_CONTROLTYPE_F ADER = (MIXERCONTROL_CT_CLASS_FAD ER Or MIXERCONTROL_CT_UNITS_UNSI GNED)
Public Const MIXERCONTROL_CONTROLTYPE_M ULTIPLESEL ECT = (MIXERCONTROL_CT_CLASS_LIS T Or MIXERCONTROL_CT_SC_LIST_MU LTIPLE Or MIXERCONTROL_CT_UNITS_BOOL EAN)
Public Const MIXERCONTROL_CONTROLTYPE_S INGLESELEC T = (MIXERCONTROL_CT_CLASS_LIS T Or MIXERCONTROL_CT_SC_LIST_SI NGLE Or MIXERCONTROL_CT_UNITS_BOOL EAN)
Public Const MIXERCONTROL_CONTROLTYPE_S IGNEDMETER = (MIXERCONTROL_CT_CLASS_MET ER Or MIXERCONTROL_CT_SC_METER_P OLLED Or MIXERCONTROL_CT_UNITS_SIGN ED)
Public Const MIXERCONTROL_CONTROLTYPE_S LIDER = (MIXERCONTROL_CT_CLASS_SLI DER Or MIXERCONTROL_CT_UNITS_SIGN ED)
Public Const MIXERCONTROL_CONTROLTYPE_B OOLEAN = (MIXERCONTROL_CT_CLASS_SWI TCH Or MIXERCONTROL_CT_SC_SWITCH_ BOOLEAN Or MIXERCONTROL_CT_UNITS_BOOL EAN)
Public Const MIXERCONTROL_CONTROLTYPE_B OOLEANMETE R = (MIXERCONTROL_CT_CLASS_MET ER Or MIXERCONTROL_CT_SC_METER_P OLLED Or MIXERCONTROL_CT_UNITS_BOOL EAN)
Public Const MIXERCONTROL_CONTROLTYPE_B UTTON = (MIXERCONTROL_CT_CLASS_SWI TCH Or MIXERCONTROL_CT_SC_SWITCH_ BUTTON Or MIXERCONTROL_CT_UNITS_BOOL EAN)
Public Const MIXERCONTROL_CONTROLTYPE_C USTOM = (MIXERCONTROL_CT_CLASS_CUS TOM Or MIXERCONTROL_CT_UNITS_CUST OM)
Public Const MIXERCONTROL_CONTROLTYPE_D ECIBELS = (MIXERCONTROL_CT_CLASS_NUM BER Or MIXERCONTROL_CT_UNITS_DECI BELS)
Public Const MIXERCONTROL_CONTROLTYPE_M ICROTIME = (MIXERCONTROL_CT_CLASS_TIM E Or MIXERCONTROL_CT_SC_TIME_MI CROSECS Or MIXERCONTROL_CT_UNITS_UNSI GNED)
Public Const MIXERCONTROL_CONTROLTYPE_M ILLITIME = (MIXERCONTROL_CT_CLASS_TIM E Or MIXERCONTROL_CT_SC_TIME_MI LLISECS Or MIXERCONTROL_CT_UNITS_UNSI GNED)
Public Const MIXERCONTROL_CONTROLTYPE_M IXER = (MIXERCONTROL_CONTROLTYPE_ MULTIPLESE LECT + 1)
Public Const MIXERCONTROL_CONTROLTYPE_M UX = (MIXERCONTROL_CONTROLTYPE_ SINGLESELE CT + 1)
Public Const MIXERCONTROL_CONTROLTYPE_P AN = (MIXERCONTROL_CONTROLTYPE_ SLIDER + 1)
Public Const MIXERCONTROL_CONTROLTYPE_Q SOUNDPAN = (MIXERCONTROL_CONTROLTYPE_ SLIDER + 2)
Public Const MIXERCONTROL_CONTROLTYPE_P EAKMETER = (MIXERCONTROL_CONTROLTYPE_ SIGNEDMETE R + 1)
Public Const MIXERCONTROL_CONTROLTYPE_O NOFF = (MIXERCONTROL_CONTROLTYPE_ BOOLEAN + 1)
Public Const MIXERCONTROL_CONTROLTYPE_M UTE = (MIXERCONTROL_CONTROLTYPE_ BOOLEAN + 2)
Public Const MIXERCONTROL_CONTROLTYPE_M ONO = (MIXERCONTROL_CONTROLTYPE_ BOOLEAN + 3)
Public Const MIXERCONTROL_CONTROLTYPE_L OUDNESS = (MIXERCONTROL_CONTROLTYPE_ BOOLEAN + 4)
Public Const MIXERCONTROL_CONTROLTYPE_S TEREOENH = (MIXERCONTROL_CONTROLTYPE_ BOOLEAN + 5)
Public Const MIXERCONTROL_CONTROLTYPE_V OLUME = (MIXERCONTROL_CONTROLTYPE_ FADER + 1)
Public Const MIXERCONTROL_CONTROLTYPE_B ASS = (MIXERCONTROL_CONTROLTYPE_ FADER + 2)
Public Const MIXERCONTROL_CONTROLTYPE_T REBLE = (MIXERCONTROL_CONTROLTYPE_ FADER + 3)
Public Const MIXERCONTROL_CONTROLTYPE_E QUALIZER = (MIXERCONTROL_CONTROLTYPE_ FADER + 4)
Public Const MIXERCONTROL_CONTROLTYPE_U NSIGNED = (MIXERCONTROL_CT_CLASS_NUM BER Or MIXERCONTROL_CT_UNITS_UNSI GNED)
Public Const MIXERCONTROL_CONTROLTYPE_U NSIGNEDMET ER = (MIXERCONTROL_CT_CLASS_MET ER Or MIXERCONTROL_CT_SC_METER_P OLLED Or MIXERCONTROL_CT_UNITS_UNSI GNED)
Public Const MIXERCONTROL_CONTROLTYPE_P ERCENT = (MIXERCONTROL_CT_CLASS_NUM BER Or MIXERCONTROL_CT_UNITS_PERC ENT)
Public Const MIXERCONTROL_CONTROLTYPE_S IGNED = (MIXERCONTROL_CT_CLASS_NUM BER Or MIXERCONTROL_CT_UNITS_SIGN ED)
Public Const MIXERLINE_COMPONENTTYPE_DS T_FIRST = &H0&
Public Const MIXERLINE_COMPONENTTYPE_DS T_DIGITAL = (MIXERLINE_COMPONENTTYPE_D ST_FIRST + 1)
Public Const MIXERLINE_COMPONENTTYPE_DS T_HEADPHON ES = (MIXERLINE_COMPONENTTYPE_D ST_FIRST + 5)
Public Const MIXERLINE_COMPONENTTYPE_DS T_LAST = (MIXERLINE_COMPONENTTYPE_D ST_FIRST + 8)
Public Const MIXERLINE_COMPONENTTYPE_DS T_LINE = (MIXERLINE_COMPONENTTYPE_D ST_FIRST + 2)
Public Const MIXERLINE_COMPONENTTYPE_DS T_MONITOR = (MIXERLINE_COMPONENTTYPE_D ST_FIRST + 3)
Public Const MIXERLINE_COMPONENTTYPE_DS T_SPEAKERS = (MIXERLINE_COMPONENTTYPE_D ST_FIRST + 4)
Public Const MIXERLINE_COMPONENTTYPE_DS T_TELEPHON E = (MIXERLINE_COMPONENTTYPE_D ST_FIRST + 6)
Public Const MIXERLINE_COMPONENTTYPE_DS T_UNDEFINE D = (MIXERLINE_COMPONENTTYPE_D ST_FIRST + 0)
Public Const MIXERLINE_COMPONENTTYPE_DS T_WAVEIN = (MIXERLINE_COMPONENTTYPE_D ST_FIRST + 7)
Public Const MIXERLINE_COMPONENTTYPE_DS T_VOICEIN = (MIXERLINE_COMPONENTTYPE_D ST_FIRST + 8)
Public Const MIXERLINE_COMPONENTTYPE_SR C_FIRST = &H1000&
Public Const MIXERLINE_COMPONENTTYPE_SR C_ANALOG = (MIXERLINE_COMPONENTTYPE_S RC_FIRST + 10)
Public Const MIXERLINE_COMPONENTTYPE_SR C_AUXILIAR Y = (MIXERLINE_COMPONENTTYPE_S RC_FIRST + 9)
Public Const MIXERLINE_COMPONENTTYPE_SR C_COMPACTD ISC = (MIXERLINE_COMPONENTTYPE_S RC_FIRST + 5)
Public Const MIXERLINE_COMPONENTTYPE_SR C_DIGITAL = (MIXERLINE_COMPONENTTYPE_S RC_FIRST + 1)
Public Const MIXERLINE_COMPONENTTYPE_SR C_LAST = (MIXERLINE_COMPONENTTYPE_S RC_FIRST + 10)
Public Const MIXERLINE_COMPONENTTYPE_SR C_LINE = (MIXERLINE_COMPONENTTYPE_S RC_FIRST + 2)
Public Const MIXERLINE_COMPONENTTYPE_SR C_MICROPHO NE = (MIXERLINE_COMPONENTTYPE_S RC_FIRST + 3)
Public Const MIXERLINE_COMPONENTTYPE_SR C_PCSPEAKE R = (MIXERLINE_COMPONENTTYPE_S RC_FIRST + 7)
Public Const MIXERLINE_COMPONENTTYPE_SR C_SYNTHESI ZER = (MIXERLINE_COMPONENTTYPE_S RC_FIRST + 4)
Public Const MIXERLINE_COMPONENTTYPE_SR C_TELEPHON E = (MIXERLINE_COMPONENTTYPE_S RC_FIRST + 6)
Public Const MIXERLINE_COMPONENTTYPE_SR C_UNDEFINE D = (MIXERLINE_COMPONENTTYPE_S RC_FIRST + 0)
Public Const MIXERLINE_COMPONENTTYPE_SR C_WAVEOUT = (MIXERLINE_COMPONENTTYPE_S RC_FIRST + 8)
Public Const MIXERLINE_LINEF_ACTIVE = &H1&
Public Const MIXERLINE_LINEF_DISCONNECT ED = &H8000&
Public Const MIXERLINE_LINEF_SOURCE = &H80000000
Public Const MIXERLINE_TARGETTYPE_AUX = 5
Public Const MIXERLINE_TARGETTYPE_MIDII N = 4
Public Const MIXERLINE_TARGETTYPE_MIDIO UT = 3
Public Const MIXERLINE_TARGETTYPE_UNDEF INED = 0
Public Const MIXERLINE_TARGETTYPE_WAVEI N = 2
Public Const MIXERLINE_TARGETTYPE_WAVEO UT = 1
Function hex$(d As Long)
Dim s As String
Dim i As Integer
s = ""
For i = 7 To 0 Step -1
s = s & hexdig((d / (2 ^ (i * 4))) And &HF)
Next i
hex$ = s
End Function
Function hexdig$(d As Long)
d = d And &HF
If d >= 10 Then hexdig$ = Chr(Asc("A") + d - 10) Else hexdig = Chr(Asc("0") + d)
End Function
Function s(sz As String) As String
If InStr(sz, Chr(0)) Then
s = Left$(sz, InStr(sz, Chr(0)) - 1)
Else
s = sz
End If
End Function
Function tolong(s As String) As Long
If Asc(Mid$(s, 4)) And &H80 Then
tolong = &H80000000 + (Asc(Mid$(s, 4)) And &H7F) * 2 ^ 24 + Asc(Mid$(s, 3)) * 2 ^ 16 + Asc(Mid$(s, 2)) * 2 ^ 8 + Asc(Mid$(s, 1))
Else
tolong = (Asc(Mid$(s, 4)) And &H7F) * 2 ^ 24 + Asc(Mid$(s, 3)) * 2 ^ 16 + Asc(Mid$(s, 2)) * 2 ^ 8 + Asc(Mid$(s, 1))
End If
End Function
-------------------------- ---------- ---------- ---------- ---------- -------
--------------------------
VERSION 4.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 8115
ClientLeft = 585
ClientTop = 720
ClientWidth = 9990
Height = 8520
Left = 525
LinkTopic = "Form1"
ScaleHeight = 8115
ScaleWidth = 9990
Top = 375
Width = 10110
Begin VB.CommandButton Command1
Caption = "Update"
Height = 255
Left = 8280
TabIndex = 0
Top = 120
Width = 1215
End
End
Attribute VB_Name = "Form1"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
'
Private Sub Command1_Click()
Cls
Dim ml As MIXERLINE
Dim mcs As MIXERCAPS
Dim mlc As MIXERLINECONTROLS
Dim mc As MIXERCONTROL
Dim mcd As MIXERCONTROLDETAILS
Dim buf(4096) As Byte
mcsize = LenB(mc) '17 * 4 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS
Dim status As Long
For i = 0 To mixerGetNumDevs - 1
status = mixerGetDevCaps(i, mcs, LenB(mcs))
' Print "mixerGetDevCaps"; status
Print "mixer "; s(mcs.szPname)
For j = 0 To mcs.cDestinations - 1
ml.cbStruct = LenB(ml)
ml.dwDestination = j
ml.dwSource = 0
status = mixerGetLineInfo(i, ml, MIXER_GETLINEINFOF_DESTINA
' Print " mixerGetLineInfo "; status
Print " destination line "; s(ml.szShortName); " = '"; s(ml.szName); "', controls: "; ml.cControls; ", connections: "; ml.cConnections
mlc.cbStruct = LenB(mlc)
mlc.dwLineID = ml.dwLineID
mlc.cControls = ml.cControls
mlc.cbmxctrl = LenB(mc)
mlc.pamxctrl = String(LenB(mc) * ml.cControls, 0)
status = mixerGetLineControls(i, mlc, MIXER_GETLINECONTROLSF_ALL
' Print " mixerGetLineControls "; status
For k = 0 To ml.cControls - 1
mc.dwControlID = tolong(Mid$(mlc.pamxctrl, k * mcsize + 1 + 4))
mc.dwControlType = tolong(Mid$(mlc.pamxctrl, k * mcsize + 1 + 2 * 4))
mc.szShortName = Mid$(mlc.pamxctrl, k * mcsize + 1 + 5 * 4, MIXER_SHORT_NAME_CHARS)
mc.szName = Mid$(mlc.pamxctrl, k * mcsize + 1 + 5 * 4 + MIXER_SHORT_NAME_CHARS, MIXER_LONG_NAME_CHARS)
' Print mc.szShortName
' Print mc.szName
' Print hex$(mc.dwControlID)
' Print hex$(mc.dwControlType)
Print " control "; s(mc.szShortName); " = '"; s(mc.szName); "', ";
Print "parsed type=[";
If mc.fdwControl & MIXERCONTROL_CONTROLF_UNIF
Print "Uniform ";
End If
Select Case (mc.dwControlType And MIXERCONTROL_CT_CLASS_MASK
Case MIXERCONTROL_CT_CLASS_CUST
Print "Custom ";
Case MIXERCONTROL_CT_CLASS_FADE
Print "Fader ";
Case MIXERCONTROL_CT_CLASS_LIST
Print "List ";
Case MIXERCONTROL_CT_CLASS_METE
Print "Meter ";
Case MIXERCONTROL_CT_CLASS_NUMB
Print "Number ";
Case MIXERCONTROL_CT_CLASS_SLID
Print "Slider ";
Case MIXERCONTROL_CT_CLASS_SWIT
Print "Switch ";
Case MIXERCONTROL_CT_CLASS_TIME
Print "Time ";
Case Else
Print "Unknown ("; hex$(mc.dwControlType And MIXERCONTROL_CT_CLASS_MASK
End Select
Select Case mc.dwControlType
Case MIXERCONTROL_CONTROLTYPE_M
Print "Mixer ";
Case MIXERCONTROL_CONTROLTYPE_M
Print "Mux ";
Case MIXERCONTROL_CONTROLTYPE_P
Print "PeakMeter ";
mcd.cbStruct = Len(mcd)
mcd.dwControlID = mc.dwControlID
If mc.fdwControl & MIXERCONTROL_CONTROLF_UNIF
mcd.cChannels = 1
Else
mcd.cChannels = ml.cChannels
End If
mcd.cbDetails = 4
mcd.item = 0
mcd.paDetails = String(4 * mcd.cChannels, 0)
status = mixerGetControlDetails(i, mcd, MIXER_GETCONTROLDETAILSF_V
For m = 1 To mcd.cChannels
Print "peak["; m; "]="; tolong(Mid$(mcd.paDetails,
Next m
Case MIXERCONTROL_CONTROLTYPE_O
Print "OnOff ";
Case MIXERCONTROL_CONTROLTYPE_M
Print "Mute ";
Case MIXERCONTROL_CONTROLTYPE_M
Print "Mono ";
Case MIXERCONTROL_CONTROLTYPE_L
Print "Loudness ";
Case MIXERCONTROL_CONTROLTYPE_S
Print "StereoEnh ";
Case MIXERCONTROL_CONTROLTYPE_V
Print "Volume ";
Case MIXERCONTROL_CONTROLTYPE_B
Print "Bass ";
Case MIXERCONTROL_CONTROLTYPE_T
Print "Treble ";
Case MIXERCONTROL_CONTROLTYPE_E
Print "Equalizer ";
Case MIXERCONTROL_CONTROLTYPE_P
Print "Pan ";
Case MIXERCONTROL_CONTROLTYPE_Q
Print "QSoundPan ";
End Select
Print "]"
Next k
For l = 0 To ml.cConnections - 1
ml.dwSource = l
status = mixerGetLineInfo(i, ml, MIXER_GETLINEINFOF_SOURCE)
' Print " mixerGetLineInfo "; status
Print " source line "; s(ml.szShortName); " = '"; s(ml.szName); "', channels: "; ml.cChannels; ", controls: "; ml.cControls
mlc.cbStruct = Len(mlc)
mlc.dwLineID = ml.dwLineID
mlc.cControls = ml.cControls
mlc.cbmxctrl = LenB(mc)
mlc.pamxctrl = String(LenB(mc) * ml.cControls, 0)
status = mixerGetLineControls(i, mlc, MIXER_GETLINECONTROLSF_ALL
' Print " mixerGetLineControls "; status
For k = 0 To ml.cControls - 1
mc.dwControlID = tolong(Mid$(mlc.pamxctrl, k * mcsize + 1 + 4))
mc.dwControlType = tolong(Mid$(mlc.pamxctrl, k * mcsize + 1 + 2 * 4))
mc.fdwControl = tolong(Mid$(mlc.pamxctrl, k * mcsize + 1 + 3 * 4))
mc.szShortName = Mid$(mlc.pamxctrl, k * mcsize + 1 + 5 * 4, MIXER_SHORT_NAME_CHARS)
mc.szName = Mid$(mlc.pamxctrl, k * mcsize + 1 + 5 * 4 + MIXER_SHORT_NAME_CHARS, MIXER_LONG_NAME_CHARS)
' Print mc.szShortName
' Print mc.szName
' Print hex$(mc.dwControlID)
' Print hex$(mc.dwControlType)
Print " control "; s(mc.szShortName); " = '"; s(mc.szName); "', ";
Print "parsed type=[";
If mc.fdwControl & MIXERCONTROL_CONTROLF_UNIF
Print "Uniform ";
End If
Select Case (mc.dwControlType And MIXERCONTROL_CT_CLASS_MASK
Case MIXERCONTROL_CT_CLASS_CUST
Print "Custom ";
Case MIXERCONTROL_CT_CLASS_FADE
Print "Fader ";
Case MIXERCONTROL_CT_CLASS_LIST
Print "List ";
Case MIXERCONTROL_CT_CLASS_METE
Print "Meter ";
Case MIXERCONTROL_CT_CLASS_NUMB
Print "Number ";
Case MIXERCONTROL_CT_CLASS_SLID
Print "Slider ";
Case MIXERCONTROL_CT_CLASS_SWIT
Print "Switch ";
Case MIXERCONTROL_CT_CLASS_TIME
Print "Time ";
Case Else
Print "Unknown ("; hex$(mc.dwControlType And MIXERCONTROL_CT_CLASS_MASK
End Select
Select Case mc.dwControlType
Case MIXERCONTROL_CONTROLTYPE_M
Print "Mixer ";
Case MIXERCONTROL_CONTROLTYPE_M
Print "Mux ";
Case MIXERCONTROL_CONTROLTYPE_P
Print "PeakMeter ";
mcd.cbStruct = Len(mcd)
mcd.dwControlID = mc.dwControlID
If mc.fdwControl & MIXERCONTROL_CONTROLF_UNIF
mcd.cChannels = 1
Else
mcd.cChannels = ml.cChannels
End If
mcd.cbDetails = 4
mcd.item = 0
mcd.paDetails = String(4 * mcd.cChannels, 0)
status = mixerGetControlDetails(i, mcd, MIXER_GETCONTROLDETAILSF_V
For m = 1 To mcd.cChannels
Print "peak["; m; "]="; tolong(Mid$(mcd.paDetails,
Next m
Case MIXERCONTROL_CONTROLTYPE_O
Print "OnOff ";
Case MIXERCONTROL_CONTROLTYPE_M
Print "Mute ";
Case MIXERCONTROL_CONTROLTYPE_M
Print "Mono ";
Case MIXERCONTROL_CONTROLTYPE_L
Print "Loudness ";
Case MIXERCONTROL_CONTROLTYPE_S
Print "StereoEnh ";
Case MIXERCONTROL_CONTROLTYPE_V
Print "Volume ";
Case MIXERCONTROL_CONTROLTYPE_B
Print "Bass ";
Case MIXERCONTROL_CONTROLTYPE_T
Print "Treble ";
Case MIXERCONTROL_CONTROLTYPE_E
Print "Equalizer ";
Case MIXERCONTROL_CONTROLTYPE_P
Print "Pan ";
Case MIXERCONTROL_CONTROLTYPE_Q
Print "QSoundPan ";
End Select
Print "]"
Next k
Next l
Next j
Next i
End Sub
--------------------------
Attribute VB_Name = "Module1"
Public Const MIXER_LONG_NAME_CHARS = 64
Public Const MIXER_SHORT_NAME_CHARS = 16
Public Const MAXPNAMELEN = 32 ' max product name length (including NULL)
Declare Function waveOutGetNumDevs Lib "winmm.dll" () As Long
Declare Function mixerOpen Lib "winmm.dll" (phmx As Long, ByVal uMxId As Long, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal fdwOpen As Long) As Long
Declare Function mixerClose Lib "winmm.dll" (ByVal hmx As Long) As Long
Declare Function mixerGetControlDetails Lib "winmm.dll" Alias "mixerGetControlDetailsA" (ByVal hmxobj As Long, pmxcd As MIXERCONTROLDETAILS, ByVal fdwDetails As Long) As Long
Declare Function mixerGetLineControls Lib "winmm.dll" Alias "mixerGetLineControlsA" (ByVal hmxobj As Long, pmxlc As MIXERLINECONTROLS, ByVal fdwControls As Long) As Long
Declare Function mixerGetDevCaps Lib "winmm.dll" Alias "mixerGetDevCapsA" (ByVal uMxId As Long, pmxcaps As MIXERCAPS, ByVal cbmxcaps As Long) As Long
Declare Function mixerGetID Lib "winmm.dll" (ByVal hmxobj As Long, pumxID As Long, ByVal fdwId As Long) As Long
Declare Function mixerGetLineInfo Lib "winmm.dll" Alias "mixerGetLineInfoA" (ByVal hmxobj As Long, pmxl As MIXERLINE, ByVal fdwInfo As Long) As Long
Declare Function mixerGetNumDevs Lib "winmm.dll" () As Long
Type MIXERCAPS
wMid As Integer ' manufacturer id
wPid As Integer ' product id
vDriverVersion As Long ' version of the driver
szPname As String * MAXPNAMELEN ' product name
fdwSupport As Long ' misc. support bits
cDestinations As Long ' count of destinations
End Type
Type MIXERCONTROL
cbStruct As Long ' size in Byte of MIXERCONTROL
dwControlID As Long ' unique control id for mixer device
dwControlType As Long ' MIXERCONTROL_CONTROLTYPE_x
fdwControl As Long ' MIXERCONTROL_CONTROLF_xxx
cMultipleItems As Long ' if MIXERCONTROL_CONTROLF_MULT
szShortName As String * MIXER_SHORT_NAME_CHARS
szName As String * MIXER_LONG_NAME_CHARS
Bounds1 As Long
Bounds2 As Long
Bounds3 As Long
Bounds4 As Long
Bounds5 As Long
Bounds6 As Long
Metrics1 As Long
Metrics2 As Long
Metrics3 As Long
Metrics4 As Long
Metrics5 As Long
Metrics6 As Long
End Type
Type MIXERCONTROLDETAILS
cbStruct As Long ' size in Byte of MIXERCONTROLDETAILS
dwControlID As Long ' control id to get/set details on
cChannels As Long ' number of channels in paDetails array
item As Long ' hwndOwner or cMultipleItems
cbDetails As Long ' size of _one_ details_XX struct
paDetails As String 'Long ' pointer to array of details_XX structs
End Type
Type MIXERCONTROLDETAILS_BOOLEA
fValue As Long
End Type
Type MIXERCONTROLDETAILS_LISTTE
dwParam1 As Long
dwParam2 As Long
szName As String * MIXER_LONG_NAME_CHARS
End Type
Type MIXERCONTROLDETAILS_SIGNED
lValue As Long
End Type
Type Target ' for use in MIXERLINE and others (embedded structure)
dwType As Long ' MIXERLINE_TARGETTYPE_xxxx
dwDeviceID As Long ' target device ID of device type
wMid As Integer ' of target device
wPid As Integer ' "
vDriverVersion As Long ' "
szPname As String * MAXPNAMELEN
End Type
Type MIXERCONTROLDETAILS_UNSIGN
dwValue As Long
End Type
Type MIXERLINE
cbStruct As Long ' size of MIXERLINE structure
dwDestination As Long ' zero based destination index
dwSource As Long ' zero based source index (if source)
dwLineID As Long ' unique line id for mixer device
fdwLine As Long ' state/information about line
dwUser As Long ' driver specific information
dwComponentType As Long ' component type line connects to
cChannels As Long ' number of channels line supports
cConnections As Long ' number of connections (possible)
cControls As Long ' number of controls at this line
szShortName As String * MIXER_SHORT_NAME_CHARS
szName As String * MIXER_LONG_NAME_CHARS
lpTarget As Target
End Type
Type MIXERLINECONTROLS
cbStruct As Long ' size in Byte of MIXERLINECONTROLS
dwLineID As Long ' line id (from MIXERLINE.dwLineID)
' MIXER_GETLINECONTROLSF_ONE
dwControl As Long ' MIXER_GETLINECONTROLSF_ONE
cControls As Long ' count of controls pmxctrl points to
cbmxctrl As Long ' size in Byte of _one_ MIXERCONTROL
pamxctrl As String 'MIXERCONTROL ' pointer to first MIXERCONTROL array
End Type
Type buf192
buf(192) As Byte
End Type
Public Const MIXER_GETCONTROLDETAILSF_L
Public Const MIXER_GETCONTROLDETAILSF_Q
Public Const MIXER_GETCONTROLDETAILSF_V
Public Const MIXER_GETLINECONTROLSF_ALL
Public Const MIXER_GETLINECONTROLSF_ONE
Public Const MIXER_GETLINECONTROLSF_ONE
Public Const MIXER_GETLINECONTROLSF_QUE
Public Const MIXER_GETLINEINFOF_COMPONE
Public Const MIXER_GETLINEINFOF_DESTINA
Public Const MIXER_GETLINEINFOF_LINEID = &H2&
Public Const MIXER_GETLINEINFOF_QUERYMA
Public Const MIXER_GETLINEINFOF_SOURCE = &H1&
Public Const MIXER_GETLINEINFOF_TARGETT
Public Const MIXER_OBJECTF_AUX = &H50000000
Public Const MIXER_OBJECTF_HANDLE = &H80000000
Public Const MIXER_OBJECTF_MIDIIN = &H40000000
Public Const MIXER_OBJECTF_MIDIOUT = &H30000000
Public Const MIXER_OBJECTF_MIXER = &H0&
Public Const MIXER_OBJECTF_WAVEIN = &H20000000
Public Const MIXER_OBJECTF_WAVEOUT = &H10000000
Public Const MIXERCONTROL_CT_CLASS_CUST
Public Const MIXERCONTROL_CT_CLASS_FADE
Public Const MIXERCONTROL_CT_CLASS_LIST
Public Const MIXERCONTROL_CT_CLASS_MASK
Public Const MIXERCONTROL_CT_CLASS_METE
Public Const MIXERCONTROL_CT_CLASS_NUMB
Public Const MIXERCONTROL_CT_CLASS_SLID
Public Const MIXERCONTROL_CT_CLASS_SWIT
Public Const MIXERCONTROL_CT_CLASS_TIME
Public Const MIXERCONTROL_CT_SC_LIST_MU
Public Const MIXERCONTROL_CT_SC_LIST_SI
Public Const MIXERCONTROL_CT_SC_METER_P
Public Const MIXERCONTROL_CT_SC_SWITCH_
Public Const MIXERCONTROL_CT_SC_SWITCH_
Public Const MIXERCONTROL_CT_SC_TIME_MI
Public Const MIXERCONTROL_CT_SC_TIME_MI
Public Const MIXERCONTROL_CT_SUBCLASS_M
Public Const MIXERCONTROL_CT_UNITS_BOOL
Public Const MIXERCONTROL_CT_UNITS_CUST
Public Const MIXERCONTROL_CT_UNITS_DECI
Public Const MIXERCONTROL_CT_UNITS_MASK
Public Const MIXERCONTROL_CT_UNITS_PERC
Public Const MIXERCONTROL_CT_UNITS_SIGN
Public Const MIXERCONTROL_CT_UNITS_UNSI
Public Const MIXER_OBJECTF_HMIDIIN = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIIN)
Public Const MIXER_OBJECTF_HMIDIOUT = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIDIOUT)
Public Const MIXER_OBJECTF_HMIXER = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_MIXER)
Public Const MIXER_OBJECTF_HWAVEIN = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEIN)
Public Const MIXER_OBJECTF_HWAVEOUT = (MIXER_OBJECTF_HANDLE Or MIXER_OBJECTF_WAVEOUT)
Public Const MIXER_SETCONTROLDETAILSF_C
Public Const MIXER_SETCONTROLDETAILSF_Q
Public Const MIXER_SETCONTROLDETAILSF_V
Public Const MIXERCONTROL_CONTROLF_DISA
Public Const MIXERCONTROL_CONTROLF_MULT
Public Const MIXERCONTROL_CONTROLF_UNIF
Public Const MIXERCONTROL_CONTROLTYPE_F
Public Const MIXERCONTROL_CONTROLTYPE_M
Public Const MIXERCONTROL_CONTROLTYPE_S
Public Const MIXERCONTROL_CONTROLTYPE_S
Public Const MIXERCONTROL_CONTROLTYPE_S
Public Const MIXERCONTROL_CONTROLTYPE_B
Public Const MIXERCONTROL_CONTROLTYPE_B
Public Const MIXERCONTROL_CONTROLTYPE_B
Public Const MIXERCONTROL_CONTROLTYPE_C
Public Const MIXERCONTROL_CONTROLTYPE_D
Public Const MIXERCONTROL_CONTROLTYPE_M
Public Const MIXERCONTROL_CONTROLTYPE_M
Public Const MIXERCONTROL_CONTROLTYPE_M
Public Const MIXERCONTROL_CONTROLTYPE_M
Public Const MIXERCONTROL_CONTROLTYPE_P
Public Const MIXERCONTROL_CONTROLTYPE_Q
Public Const MIXERCONTROL_CONTROLTYPE_P
Public Const MIXERCONTROL_CONTROLTYPE_O
Public Const MIXERCONTROL_CONTROLTYPE_M
Public Const MIXERCONTROL_CONTROLTYPE_M
Public Const MIXERCONTROL_CONTROLTYPE_L
Public Const MIXERCONTROL_CONTROLTYPE_S
Public Const MIXERCONTROL_CONTROLTYPE_V
Public Const MIXERCONTROL_CONTROLTYPE_B
Public Const MIXERCONTROL_CONTROLTYPE_T
Public Const MIXERCONTROL_CONTROLTYPE_E
Public Const MIXERCONTROL_CONTROLTYPE_U
Public Const MIXERCONTROL_CONTROLTYPE_U
Public Const MIXERCONTROL_CONTROLTYPE_P
Public Const MIXERCONTROL_CONTROLTYPE_S
Public Const MIXERLINE_COMPONENTTYPE_DS
Public Const MIXERLINE_COMPONENTTYPE_DS
Public Const MIXERLINE_COMPONENTTYPE_DS
Public Const MIXERLINE_COMPONENTTYPE_DS
Public Const MIXERLINE_COMPONENTTYPE_DS
Public Const MIXERLINE_COMPONENTTYPE_DS
Public Const MIXERLINE_COMPONENTTYPE_DS
Public Const MIXERLINE_COMPONENTTYPE_DS
Public Const MIXERLINE_COMPONENTTYPE_DS
Public Const MIXERLINE_COMPONENTTYPE_DS
Public Const MIXERLINE_COMPONENTTYPE_DS
Public Const MIXERLINE_COMPONENTTYPE_SR
Public Const MIXERLINE_COMPONENTTYPE_SR
Public Const MIXERLINE_COMPONENTTYPE_SR
Public Const MIXERLINE_COMPONENTTYPE_SR
Public Const MIXERLINE_COMPONENTTYPE_SR
Public Const MIXERLINE_COMPONENTTYPE_SR
Public Const MIXERLINE_COMPONENTTYPE_SR
Public Const MIXERLINE_COMPONENTTYPE_SR
Public Const MIXERLINE_COMPONENTTYPE_SR
Public Const MIXERLINE_COMPONENTTYPE_SR
Public Const MIXERLINE_COMPONENTTYPE_SR
Public Const MIXERLINE_COMPONENTTYPE_SR
Public Const MIXERLINE_COMPONENTTYPE_SR
Public Const MIXERLINE_LINEF_ACTIVE = &H1&
Public Const MIXERLINE_LINEF_DISCONNECT
Public Const MIXERLINE_LINEF_SOURCE = &H80000000
Public Const MIXERLINE_TARGETTYPE_AUX = 5
Public Const MIXERLINE_TARGETTYPE_MIDII
Public Const MIXERLINE_TARGETTYPE_MIDIO
Public Const MIXERLINE_TARGETTYPE_UNDEF
Public Const MIXERLINE_TARGETTYPE_WAVEI
Public Const MIXERLINE_TARGETTYPE_WAVEO
Function hex$(d As Long)
Dim s As String
Dim i As Integer
s = ""
For i = 7 To 0 Step -1
s = s & hexdig((d / (2 ^ (i * 4))) And &HF)
Next i
hex$ = s
End Function
Function hexdig$(d As Long)
d = d And &HF
If d >= 10 Then hexdig$ = Chr(Asc("A") + d - 10) Else hexdig = Chr(Asc("0") + d)
End Function
Function s(sz As String) As String
If InStr(sz, Chr(0)) Then
s = Left$(sz, InStr(sz, Chr(0)) - 1)
Else
s = sz
End If
End Function
Function tolong(s As String) As Long
If Asc(Mid$(s, 4)) And &H80 Then
tolong = &H80000000 + (Asc(Mid$(s, 4)) And &H7F) * 2 ^ 24 + Asc(Mid$(s, 3)) * 2 ^ 16 + Asc(Mid$(s, 2)) * 2 ^ 8 + Asc(Mid$(s, 1))
Else
tolong = (Asc(Mid$(s, 4)) And &H7F) * 2 ^ 24 + Asc(Mid$(s, 3)) * 2 ^ 16 + Asc(Mid$(s, 2)) * 2 ^ 8 + Asc(Mid$(s, 1))
End If
End Function
--------------------------
ASKER
you gave me this function before in another question...but I have no idea of how to use it =(
ASKER