home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 3_2004-2005.ISO / Data / Zips / Matt_Playe176515722004.psc / FFT / mixer / Mixer.bas < prev    next >
BASIC Source File  |  2004-07-02  |  9KB  |  175 lines

  1. Attribute VB_Name = "Module1"
  2. ' THis module contains all of the Mixer declares and constants.
  3. ' Author: Matt Gillmore (SCO_STINKS@YAHOO.com)
  4.  
  5. Option Explicit
  6.  
  7. Const MIXERCONTROL_CT_CLASS_CUSTOM = &H0&
  8. Const MIXERCONTROL_CT_CLASS_FADER = &H50000000
  9. Const MIXERCONTROL_CT_CLASS_LIST = &H70000000
  10. Const MIXERCONTROL_CT_CLASS_MASK = &HF0000000
  11. Const MIXERCONTROL_CT_CLASS_METER = &H10000000
  12. Const MIXERCONTROL_CT_CLASS_NUMBER = &H30000000
  13. Const MIXERCONTROL_CT_CLASS_SLIDER = &H40000000
  14. Const MIXERCONTROL_CT_CLASS_SWITCH = &H20000000
  15. Const MIXERCONTROL_CT_CLASS_TIME = &H60000000
  16. Const MIXERCONTROL_CT_SC_LIST_MULTIPLE = &H1000000
  17. Const MIXERCONTROL_CT_SC_LIST_SINGLE = &H0&
  18. Const MIXERCONTROL_CT_SC_METER_POLLED = &H0&
  19. Const MIXERCONTROL_CT_SC_SWITCH_BOOLEAN = &H0&
  20. Const MIXERCONTROL_CT_SC_SWITCH_BUTTON = &H1000000
  21. Const MIXERCONTROL_CT_SC_TIME_MICROSECS = &H0&
  22. Const MIXERCONTROL_CT_SC_TIME_MILLISECS = &H1000000
  23. Const MIXERCONTROL_CT_SUBCLASS_MASK = &HF000000
  24. Const MIXERCONTROL_CT_UNITS_BOOLEAN = &H10000
  25. Const MIXERCONTROL_CT_UNITS_CUSTOM = &H0&
  26. Const MIXERCONTROL_CT_UNITS_DECIBELS = &H40000
  27. Const MIXERCONTROL_CT_UNITS_MASK = &HFF0000
  28. Const MIXERCONTROL_CT_UNITS_PERCENT = &H50000
  29. Const MIXERCONTROL_CT_UNITS_SIGNED = &H20000
  30. Const MIXERCONTROL_CT_UNITS_UNSIGNED = &H30000
  31.  
  32. Const MIXERCONTROL_CONTROLTYPE_SIGNEDMETER = (MIXERCONTROL_CT_CLASS_METER Or MIXERCONTROL_CT_SC_METER_POLLED Or MIXERCONTROL_CT_UNITS_SIGNED)
  33. Const MIXERCONTROL_CONTROLTYPE_SLIDER = (MIXERCONTROL_CT_CLASS_SLIDER Or MIXERCONTROL_CT_UNITS_SIGNED)
  34. Const MIXERCONTROL_CONTROLTYPE_SINGLESELECT = (MIXERCONTROL_CT_CLASS_LIST Or MIXERCONTROL_CT_SC_LIST_SINGLE Or MIXERCONTROL_CT_UNITS_BOOLEAN)
  35. Const MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT = (MIXERCONTROL_CT_CLASS_LIST Or MIXERCONTROL_CT_SC_LIST_MULTIPLE Or MIXERCONTROL_CT_UNITS_BOOLEAN)
  36. Const MIXERCONTROL_CONTROLTYPE_FADER = (MIXERCONTROL_CT_CLASS_FADER Or MIXERCONTROL_CT_UNITS_UNSIGNED)
  37. Const MIXERCONTROL_CONTROLTYPE_BASS = (MIXERCONTROL_CONTROLTYPE_FADER + 2)
  38. Const MIXERCONTROL_CONTROLTYPE_BOOLEAN = (MIXERCONTROL_CT_CLASS_SWITCH Or MIXERCONTROL_CT_SC_SWITCH_BOOLEAN Or MIXERCONTROL_CT_UNITS_BOOLEAN)
  39. Const MIXERCONTROL_CONTROLTYPE_BOOLEANMETER = (MIXERCONTROL_CT_CLASS_METER Or MIXERCONTROL_CT_SC_METER_POLLED Or MIXERCONTROL_CT_UNITS_BOOLEAN)
  40. Const MIXERCONTROL_CONTROLTYPE_BUTTON = (MIXERCONTROL_CT_CLASS_SWITCH Or MIXERCONTROL_CT_SC_SWITCH_BUTTON Or MIXERCONTROL_CT_UNITS_BOOLEAN)
  41. Const MIXERCONTROL_CONTROLTYPE_CUSTOM = (MIXERCONTROL_CT_CLASS_CUSTOM Or MIXERCONTROL_CT_UNITS_CUSTOM)
  42. Const MIXERCONTROL_CONTROLTYPE_DECIBELS = (MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_DECIBELS)
  43. Const MIXERCONTROL_CONTROLTYPE_EQUALIZER = (MIXERCONTROL_CONTROLTYPE_FADER + 4)
  44. Const MIXERCONTROL_CONTROLTYPE_LOUDNESS = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 4)
  45. Const MIXERCONTROL_CONTROLTYPE_MICROTIME = (MIXERCONTROL_CT_CLASS_TIME Or MIXERCONTROL_CT_SC_TIME_MICROSECS Or MIXERCONTROL_CT_UNITS_UNSIGNED)
  46. Const MIXERCONTROL_CONTROLTYPE_MILLITIME = (MIXERCONTROL_CT_CLASS_TIME Or MIXERCONTROL_CT_SC_TIME_MILLISECS Or MIXERCONTROL_CT_UNITS_UNSIGNED)
  47. Const MIXERCONTROL_CONTROLTYPE_MIXER = (MIXERCONTROL_CONTROLTYPE_MULTIPLESELECT + 1)
  48. Const MIXERCONTROL_CONTROLTYPE_MONO = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 3)
  49. Const MIXERCONTROL_CONTROLTYPE_MUTE = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 2)
  50. Const MIXERCONTROL_CONTROLTYPE_MUX = (MIXERCONTROL_CONTROLTYPE_SINGLESELECT + 1)
  51. Const MIXERCONTROL_CONTROLTYPE_ONOFF = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 1)
  52. Const MIXERCONTROL_CONTROLTYPE_PAN = (MIXERCONTROL_CONTROLTYPE_SLIDER + 1)
  53. Const MIXERCONTROL_CONTROLTYPE_PEAKMETER = (MIXERCONTROL_CONTROLTYPE_SIGNEDMETER + 1)
  54. Const MIXERCONTROL_CONTROLTYPE_PERCENT = (MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_PERCENT)
  55. Const MIXERCONTROL_CONTROLTYPE_QSOUNDPAN = (MIXERCONTROL_CONTROLTYPE_SLIDER + 2)
  56. Const MIXERCONTROL_CONTROLTYPE_SIGNED = (MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_SIGNED)
  57. Const MIXERCONTROL_CONTROLTYPE_STEREOENH = (MIXERCONTROL_CONTROLTYPE_BOOLEAN + 5)
  58. Const MIXERCONTROL_CONTROLTYPE_TREBLE = (MIXERCONTROL_CONTROLTYPE_FADER + 3)
  59. Const MIXERCONTROL_CONTROLTYPE_UNSIGNED = (MIXERCONTROL_CT_CLASS_NUMBER Or MIXERCONTROL_CT_UNITS_UNSIGNED)
  60. Const MIXERCONTROL_CONTROLTYPE_UNSIGNEDMETER = (MIXERCONTROL_CT_CLASS_METER Or MIXERCONTROL_CT_SC_METER_POLLED Or MIXERCONTROL_CT_UNITS_UNSIGNED)
  61. Const MIXERCONTROL_CONTROLTYPE_VOLUME = (MIXERCONTROL_CONTROLTYPE_FADER + 1)
  62.  
  63. Const MMSYSERR_NOERROR = 0
  64. Const MAXPNAMELEN = 32
  65. Const MIXER_LONG_NAME_CHARS = 64
  66. Const MIXER_SHORT_NAME_CHARS = 16
  67. Const MIXER_GETLINEINFOF_COMPONENTTYPE = &H3&
  68. Const MIXER_GETCONTROLDETAILSF_VALUE = &H0&
  69. Const MIXER_GETCONTROLDETAILSF_LISTTEXT& = &H1&
  70. Const MIXER_GETLINECONTROLSF_ONEBYTYPE = &H2&
  71. Const MIXER_OBJECTF_WAVEOUT& = &H10000000
  72. Const MIXER_SETCONTROLDETAILSF_VALUE = &H0&
  73.  
  74. Const MIXER_OBJECTF_WAVEIN = &H20000000
  75.  
  76. Const MIXERLINE_COMPONENTTYPE_SRC_FIRST = &H1000&
  77. Const MIXERLINE_COMPONENTTYPE_SRC_DIGITAL& = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 1)
  78. Const MIXERLINE_COMPONENTTYPE_SRC_LINE = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 2)
  79. Const MIXERLINE_COMPONENTTYPE_SRC_MICROPHONE = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 3)
  80. Const MIXERLINE_COMPONENTTYPE_SRC_COMPACTDISC& = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 5)
  81. Const MIXERLINE_COMPONENTTYPE_SRC_WAVEOUT& = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 8)
  82. Const MIXERLINE_COMPONENTTYPE_SRC_AUXILIARY& = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 9)
  83. Const MIXERLINE_COMPONENTTYPE_SRC_ANALOG& = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 10)
  84. Const MIXERLINE_COMPONENTTYPE_DST_FIRST = &H0&
  85. Const MIXERLINE_COMPONENTTYPE_DST_DIGITAL& = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 1)
  86. Const MIXERLINE_COMPONENTTYPE_DST_Micro = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 3)
  87. Const MIXERLINE_COMPONENTTYPE_DST_SPEAKERS = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 4)
  88. Const MIXERLINE_COMPONENTTYPE_DST_CD = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 5)
  89. Const MIXERLINE_COMPONENTTYPE_DST_WAVEIN& = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 7)
  90. Const MIXERLINE_COMPONENTTYPE_DST_VOICEIN& = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8)
  91. Const MIXERLINE_COMPONENTTYPE_SRC_PCSPEAKER = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 7)
  92.  
  93. Type MIXERCAPS
  94.     wMid As Integer
  95.     wPid As Integer
  96.     vDriverVersion As Long
  97.     szPname As String * MAXPNAMELEN
  98.     fdwSupport As Long
  99.     cDestinations As Long
  100. End Type
  101.  
  102. Type MIXERCONTROL
  103.     cbStruct As Long
  104.     dwControlID As Long
  105.     dwControlType As Long
  106.     fdwControl As Long
  107.     cMultipleItems As Long
  108.     szShortName As String * MIXER_SHORT_NAME_CHARS
  109.     szName As String * MIXER_LONG_NAME_CHARS
  110.     lMinimum As Long
  111.     lMaximum As Long
  112.     reserved(9) As Long
  113. End Type
  114.  
  115. Type MIXERCONTROLDETAILS
  116.     cbStruct As Long
  117.     dwControlID As Long
  118.     cChannels As Long
  119.     item As Long
  120.     cbDetails As Long
  121.     paDetails As Long
  122. End Type
  123.  
  124. Type MIXERCONTROLDETAILS_UNSIGNED
  125.     dwValue As Long
  126. End Type
  127.  
  128. Type MIXERLINE
  129.     cbStruct As Long
  130.     dwDestination As Long
  131.     dwSource As Long
  132.     dwLineID As Long
  133.     fdwLine As Long
  134.     dwUser As Long
  135.     dwComponentType As Long
  136.     cChannels As Long
  137.     cConnections As Long
  138.     cControls As Long
  139.     szShortName As String * MIXER_SHORT_NAME_CHARS
  140.     szName As String * MIXER_LONG_NAME_CHARS
  141.     dwType As Long
  142.     dwDeviceID As Long
  143.     wMid  As Integer
  144.     wPid As Integer
  145.     vDriverVersion As Long
  146.     szPname As String * MAXPNAMELEN
  147. End Type
  148.  
  149. Type MIXERLINECONTROLS
  150.     cbStruct As Long
  151.     dwLineID As Long
  152.     dwControl As Long
  153.     cControls As Long
  154.     cbmxctrl As Long
  155.     pamxctrl As Long
  156. End Type
  157.  
  158. Declare Function mixerClose& Lib "winmm.dll" (ByVal hmx&)
  159. Declare Function mixerGetControlDetails& Lib "winmm.dll" Alias "mixerGetControlDetailsA" (ByVal hmxobj&, pmxcd As MIXERCONTROLDETAILS, ByVal fdwDetails&)
  160. Declare Function mixerGetDevCaps& Lib "winmm.dll" Alias "mixerGetDevCapsA" (ByVal uMxId&, pmxcaps As MIXERCAPS, ByVal cbmxcaps&)
  161. Declare Function mixerGetID& Lib "winmm.dll" (ByVal hmxobj&, pumxID&, ByVal fdwId&)
  162. Declare Function mixerGetLineControls& Lib "winmm.dll" Alias "mixerGetLineControlsA" (ByVal hmxobj&, pmxlc As MIXERLINECONTROLS, ByVal fdwControls&)
  163. Declare Function mixerGetLineInfo& Lib "winmm.dll" Alias "mixerGetLineInfoA" (ByVal hmxobj&, pmxl As MIXERLINE, ByVal fdwInfo&)
  164. Declare Function mixerGetNumDevs& Lib "winmm.dll" ()
  165. Declare Function mixerMessage& Lib "winmm.dll" (ByVal hmx&, ByVal uMsg&, ByVal dwParam1&, ByVal dwParam2&)
  166. Declare Function mixerOpen& Lib "winmm.dll" (phmx&, ByVal uMxId&, ByVal dwCallback&, ByVal dwInstance&, ByVal fdwOpen&)
  167. Declare Function mixerSetControlDetails& Lib "winmm.dll" (ByVal hmxobj&, pmxcd As MIXERCONTROLDETAILS, ByVal fdwDetails&)
  168. Declare Sub CopyStructFromPtr Lib "kernel32" Alias "RtlMoveMemory" (struct As Any, ByVal ptr&, ByVal cb&)
  169. Declare Sub CopyPtrFromStruct Lib "kernel32" Alias "RtlMoveMemory" (ByVal ptr&, struct As Any, ByVal cb&)
  170. Declare Function GlobalAlloc& Lib "kernel32" (ByVal wFlags&, ByVal dwBytes&)
  171. Declare Function GlobalLock& Lib "kernel32" (ByVal hMem&)
  172. Declare Function GlobalFree& Lib "kernel32" (ByVal hMem&)
  173.  
  174.  
  175.