Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1000 lines
30 KiB

  1. //==========================================================================;
  2. //
  3. // msmixmgr.h -- Include file for Microsoft Audio Mixer Manager API's
  4. //
  5. // Version 3.10 (16 Bit)
  6. //
  7. // Copyright (C) 1992, 1993 Microsoft Corporation. All Rights Reserved.
  8. //
  9. //--------------------------------------------------------------------------;
  10. //
  11. // Define: Prevent inclusion of:
  12. // -------------- --------------------------------------------------------
  13. // MMNOMIXER Mixer application development support
  14. // MMNOMIXERDEV Mixer driver development support
  15. //
  16. //--------------------------------------------------------------------------;
  17. //
  18. // NOTE: mmsystem.h (and mmddk.h for drivers) must be included _before_
  19. // msmixmgr.h is included.
  20. //
  21. // For mixer applications: For mixer drivers:
  22. //
  23. // #include <windows.h> #include <windows.h>
  24. // #include <windowsx.h> #include <windowsx.h>
  25. // #include <mmsystem.h> #include <mmsystem.h>
  26. // #include <msmixmgr.h> #include <mmddk.h>
  27. // . . . #include <msmixmgr.h>
  28. // . . .
  29. //
  30. //==========================================================================;
  31. #ifndef _INC_MSMIXMGR
  32. #define _INC_MSMIXMGR // #defined if msmixmgr.h was included
  33. #ifndef RC_INVOKED
  34. #pragma pack(1) // assume byte packing throughout
  35. #endif
  36. #ifdef __cplusplus
  37. extern "C" // assume C declarations for C++
  38. {
  39. #endif // __cplusplus
  40. //
  41. //
  42. //
  43. //
  44. #ifndef _MMRESULT_
  45. #define _MMRESULT_
  46. typedef UINT MMRESULT;
  47. #endif
  48. #ifndef _MMVERSION_
  49. #define _MMVERSION_
  50. typedef UINT MMVERSION;
  51. #endif
  52. //==========================================================================;
  53. //
  54. // Mixer Application Definitions
  55. //
  56. //
  57. //
  58. //==========================================================================;
  59. #ifdef _INC_MMSYSTEM
  60. #ifndef MMNOMIXER
  61. #ifndef MM_MIXM_LINE_CHANGE
  62. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  63. //
  64. //
  65. //
  66. //
  67. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  68. #ifdef WIN32
  69. #define MIXAPI APIENTRY
  70. #else
  71. #ifdef _WINDLL
  72. #define MIXAPI _far _pascal _loadds
  73. #else
  74. #define MIXAPI _far _pascal
  75. #endif
  76. #endif
  77. //
  78. // mixer callback notification messages. these messages are sent to all
  79. // clients that have an open instance to a mixer device and have requested
  80. // notifications by supplying a callback.
  81. //
  82. // CALLBACK_WINDOW:
  83. //
  84. // uMsg = MM_MIXM_LINE_CHANGE
  85. // wParam = hmx
  86. // lParam = dwLineID
  87. //
  88. // uMsg = MM_MIXM_CONTROL_CHANGE
  89. // wParam = hmx
  90. // lParam = dwControlID
  91. //
  92. //
  93. #define MM_MIXM_LINE_CHANGE 0x3D0 // mixer line change notify
  94. #define MM_MIXM_CONTROL_CHANGE 0x3D1 // mixer control change notify
  95. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  96. //
  97. //
  98. //
  99. //
  100. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  101. DECLARE_HANDLE(HMIXEROBJ);
  102. typedef HMIXEROBJ FAR *LPHMIXEROBJ;
  103. DECLARE_HANDLE(HMIXER);
  104. typedef HMIXER FAR *LPHMIXER;
  105. //
  106. //
  107. //
  108. #define MIXER_SHORT_NAME_CHARS 16
  109. #define MIXER_LONG_NAME_CHARS 64
  110. //
  111. // MMRESULT error return values specific to the mixer API
  112. //
  113. //
  114. #define MIXERR_BASE 1024
  115. #define MIXERR_INVALLINE (MIXERR_BASE + 0)
  116. #define MIXERR_INVALCONTROL (MIXERR_BASE + 1)
  117. #define MIXERR_INVALVALUE (MIXERR_BASE + 2)
  118. #define MIXERR_LASTERROR (MIXERR_BASE + 2)
  119. //
  120. //
  121. //
  122. #define MIXER_OBJECTF_HANDLE 0x80000000L
  123. #define MIXER_OBJECTF_MIXER 0x00000000L
  124. #define MIXER_OBJECTF_HMIXER (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIXER)
  125. #define MIXER_OBJECTF_WAVEOUT 0x10000000L
  126. #define MIXER_OBJECTF_HWAVEOUT (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEOUT)
  127. #define MIXER_OBJECTF_WAVEIN 0x20000000L
  128. #define MIXER_OBJECTF_HWAVEIN (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEIN)
  129. #define MIXER_OBJECTF_MIDIOUT 0x30000000L
  130. #define MIXER_OBJECTF_HMIDIOUT (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIOUT)
  131. #define MIXER_OBJECTF_MIDIIN 0x40000000L
  132. #define MIXER_OBJECTF_HMIDIIN (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIIN)
  133. #define MIXER_OBJECTF_AUX 0x50000000L
  134. #define MIXER_OBJECTF_TYPEMASK 0xF0000000L // ;Internal
  135. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  136. //
  137. // mixerGetNumDevs()
  138. //
  139. //
  140. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  141. UINT MIXAPI mixerGetNumDevs
  142. (
  143. void
  144. );
  145. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  146. //
  147. // mixerGetDevCaps()
  148. //
  149. //
  150. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  151. typedef struct tMIXERCAPS
  152. {
  153. WORD wMid; // manufacturer id
  154. WORD wPid; // product id
  155. MMVERSION vDriverVersion; // version of the driver
  156. char szPname[MAXPNAMELEN]; // product name
  157. DWORD fdwSupport; // misc. support bits
  158. DWORD cDestinations; // count of destinations
  159. } MIXERCAPS;
  160. typedef MIXERCAPS *PMIXERCAPS;
  161. typedef MIXERCAPS FAR *LPMIXERCAPS;
  162. #define MIXERCAPS_SUPPORTF_xxx 0x00000000L // ;Internal
  163. //
  164. //
  165. //
  166. MMRESULT MIXAPI mixerGetDevCaps
  167. (
  168. UINT uMxId,
  169. LPMIXERCAPS pmxcaps,
  170. UINT cbmxcaps
  171. );
  172. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  173. //
  174. // mixerGetID()
  175. //
  176. //
  177. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  178. MMRESULT MIXAPI mixerGetID
  179. (
  180. HMIXEROBJ hmxobj,
  181. UINT FAR *puMxId,
  182. DWORD fdwId
  183. );
  184. #define MIXER_GETIDF_VALID (MIXER_OBJECTF_TYPEMASK) // ;Internal
  185. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  186. //
  187. // mixerOpen()
  188. //
  189. //
  190. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  191. MMRESULT MIXAPI mixerOpen
  192. (
  193. LPHMIXER phmx,
  194. UINT uMxId,
  195. DWORD dwCallback,
  196. DWORD dwInstance,
  197. DWORD fdwOpen
  198. );
  199. #define MIXER_OPENF_VALID (MIXER_OBJECTF_TYPEMASK | /* ;Internal */ \
  200. CALLBACK_TYPEMASK) // ;Internal
  201. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  202. //
  203. // mixerClose()
  204. //
  205. //
  206. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  207. MMRESULT MIXAPI mixerClose
  208. (
  209. HMIXER hmx
  210. );
  211. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  212. //
  213. // mixerMessage()
  214. //
  215. //
  216. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  217. DWORD MIXAPI mixerMessage
  218. (
  219. HMIXER hmx,
  220. UINT uMsg,
  221. DWORD dwParam1,
  222. DWORD dwParam2
  223. );
  224. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  225. //
  226. // mixerGetLineInfo()
  227. //
  228. //
  229. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  230. typedef struct tMIXERLINE
  231. {
  232. DWORD cbStruct; // size of MIXERLINE structure
  233. DWORD dwDestination; // zero based destination index
  234. DWORD dwSource; // zero based source index (if source)
  235. DWORD dwLineID; // unique line id for mixer device
  236. DWORD fdwLine; // state/information about line
  237. DWORD dwUser; // driver specific information
  238. DWORD dwComponentType; // component type line connects to
  239. DWORD cChannels; // number of channels line supports
  240. DWORD cConnections; // number of connections [possible]
  241. DWORD cControls; // number of controls at this line
  242. char szShortName[MIXER_SHORT_NAME_CHARS];
  243. char szName[MIXER_LONG_NAME_CHARS];
  244. struct
  245. {
  246. DWORD dwType; // MIXERLINE_TARGETTYPE_xxxx
  247. DWORD dwDeviceID; // target device ID of device type
  248. WORD wMid; // of target device
  249. WORD wPid; // "
  250. MMVERSION vDriverVersion; // "
  251. char szPname[MAXPNAMELEN]; // "
  252. } Target;
  253. } MIXERLINE;
  254. typedef MIXERLINE *PMIXERLINE;
  255. typedef MIXERLINE FAR *LPMIXERLINE;
  256. //
  257. // MIXERLINE.fdwLine
  258. //
  259. //
  260. #define MIXERLINE_LINEF_ACTIVE 0x00000001L
  261. #define MIXERLINE_LINEF_DISCONNECTED 0x00008000L
  262. #define MIXERLINE_LINEF_SOURCE 0x80000000L
  263. //
  264. // MIXERLINE.dwComponentType
  265. //
  266. // component types for destinations and sources
  267. //
  268. //
  269. #define MLCT_DST_FIRST 0x00000000L
  270. #define MLCT_DST_UNDEFINED (MLCT_DST_FIRST + 0)
  271. #define MLCT_DST_DIGITAL (MLCT_DST_FIRST + 1)
  272. #define MLCT_DST_LINE (MLCT_DST_FIRST + 2)
  273. #define MLCT_DST_MONITOR (MLCT_DST_FIRST + 3)
  274. #define MLCT_DST_SPEAKERS (MLCT_DST_FIRST + 4)
  275. #define MLCT_DST_HEADPHONES (MLCT_DST_FIRST + 5)
  276. #define MLCT_DST_TELEPHONE (MLCT_DST_FIRST + 6)
  277. #define MLCT_DST_WAVEIN (MLCT_DST_FIRST + 7)
  278. #define MLCT_DST_VOICEIN (MLCT_DST_FIRST + 8)
  279. #define MLCT_DST_LAST (MLCT_DST_FIRST + 8)
  280. #define MLCT_SRC_FIRST 0x00001000L
  281. #define MLCT_SRC_UNDEFINED (MLCT_SRC_FIRST + 0)
  282. #define MLCT_SRC_DIGITAL (MLCT_SRC_FIRST + 1)
  283. #define MLCT_SRC_LINE (MLCT_SRC_FIRST + 2)
  284. #define MLCT_SRC_MICROPHONE (MLCT_SRC_FIRST + 3)
  285. #define MLCT_SRC_SYNTHESIZER (MLCT_SRC_FIRST + 4)
  286. #define MLCT_SRC_COMPACTDISC (MLCT_SRC_FIRST + 5)
  287. #define MLCT_SRC_TELEPHONE (MLCT_SRC_FIRST + 6)
  288. #define MLCT_SRC_PCSPEAKER (MLCT_SRC_FIRST + 7)
  289. #define MLCT_SRC_WAVEOUT (MLCT_SRC_FIRST + 8)
  290. #define MLCT_SRC_AUXILIARY (MLCT_SRC_FIRST + 9)
  291. #define MLCT_SRC_ANALOG (MLCT_SRC_FIRST + 10)
  292. #define MLCT_SRC_LAST (MLCT_SRC_FIRST + 10)
  293. //
  294. // MIXERLINE.Target.dwType
  295. //
  296. //
  297. #define MIXERLINE_TARGETTYPE_UNDEFINED 0
  298. #define MIXERLINE_TARGETTYPE_WAVEOUT 1
  299. #define MIXERLINE_TARGETTYPE_WAVEIN 2
  300. #define MIXERLINE_TARGETTYPE_MIDIOUT 3
  301. #define MIXERLINE_TARGETTYPE_MIDIIN 4
  302. #define MIXERLINE_TARGETTYPE_AUX 5
  303. //
  304. //
  305. //
  306. //
  307. MMRESULT MIXAPI mixerGetLineInfo
  308. (
  309. HMIXEROBJ hmxobj,
  310. LPMIXERLINE pmxl,
  311. DWORD fdwInfo
  312. );
  313. #define M_GLINFOF_DESTINATION 0x00000000L
  314. #define M_GLINFOF_SOURCE 0x00000001L
  315. #define M_GLINFOF_LINEID 0x00000002L
  316. #define M_GLINFOF_COMPONENTTYPE 0x00000003L
  317. #define M_GLINFOF_TARGETTYPE 0x00000004L
  318. #define M_GLINFOF_QUERYMASK 0x0000000FL
  319. #define M_GLINFOF_VALID (MIXER_OBJECTF_TYPEMASK | /* ;Internal */ \
  320. M_GLINFOF_QUERYMASK) // ;Internal
  321. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  322. //
  323. // mixerGetLineControls()
  324. //
  325. //
  326. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  327. //
  328. // MIXERCONTROL
  329. //
  330. //
  331. typedef struct tMIXERCONTROL
  332. {
  333. DWORD cbStruct; // size in bytes of MIXERCONTROL
  334. DWORD dwControlID; // unique control id for mixer device
  335. DWORD dwControlType; // MC_CONTROLTYPE_xxx
  336. DWORD fdwControl; // MC_CONTROLF_xxx
  337. DWORD cMultipleItems; // if MC_CONTROLF_MULTIPLE set
  338. char szShortName[MIXER_SHORT_NAME_CHARS];
  339. char szName[MIXER_LONG_NAME_CHARS];
  340. union
  341. {
  342. struct
  343. {
  344. LONG lMinimum; // signed minimum for this control
  345. LONG lMaximum; // signed maximum for this control
  346. };
  347. struct
  348. {
  349. DWORD dwMinimum; // unsigned minimum for this control
  350. DWORD dwMaximum; // unsigned maximum for this control
  351. };
  352. DWORD dwReserved[6];
  353. } Bounds;
  354. union
  355. {
  356. DWORD cSteps; // # of steps between min & max
  357. DWORD cbCustomData; // size in bytes of custom data
  358. DWORD dwReserved[6]; // !!! needed? we have cbStruct....
  359. } Metrics;
  360. } MIXERCONTROL;
  361. typedef MIXERCONTROL *PMIXERCONTROL;
  362. typedef MIXERCONTROL FAR *LPMIXERCONTROL;
  363. //
  364. // MIXERCONTROL.fdwControl
  365. //
  366. //
  367. #define MC_CONTROLF_UNIFORM 0x00000001L
  368. #define MC_CONTROLF_MULTIPLE 0x00000002L
  369. #define MC_CONTROLF_DISABLED 0x80000000L
  370. #define MC_CONTROLF_VALID (MC_CONTROLF_UNIFORM | /* ;Internal */ \
  371. MC_CONTROLF_MULTIPLE | /* ;Internal */ \
  372. MC_CONTROLF_DISABLED) /* ;Internal */
  373. //
  374. // MC_CONTROLTYPE_xxx building block defines
  375. //
  376. //
  377. #define MC_CT_CLASS_MASK 0xF0000000L
  378. #define MC_CT_CLASS_CUSTOM 0x00000000L
  379. #define MC_CT_CLASS_METER 0x10000000L
  380. #define MC_CT_CLASS_SWITCH 0x20000000L
  381. #define MC_CT_CLASS_NUMBER 0x30000000L
  382. #define MC_CT_CLASS_SLIDER 0x40000000L
  383. #define MC_CT_CLASS_FADER 0x50000000L
  384. #define MC_CT_CLASS_TIME 0x60000000L
  385. #define MC_CT_CLASS_LIST 0x70000000L
  386. #define MC_CT_SUBCLASS_MASK 0x0F000000L
  387. #define MC_CT_SC_SWITCH_BOOLEAN 0x00000000L
  388. #define MC_CT_SC_SWITCH_BUTTON 0x01000000L
  389. #define MC_CT_SC_METER_POLLED 0x00000000L
  390. #define MC_CT_SC_TIME_MICROSECS 0x00000000L
  391. #define MC_CT_SC_TIME_MILLISECS 0x01000000L
  392. #define MC_CT_SC_LIST_SINGLE 0x00000000L
  393. #define MC_CT_SC_LIST_MULTIPLE 0x01000000L
  394. #define MC_CT_UNITS_MASK 0x00FF0000L
  395. #define MC_CT_UNITS_CUSTOM 0x00000000L
  396. #define MC_CT_UNITS_BOOLEAN 0x00010000L
  397. #define MC_CT_UNITS_SIGNED 0x00020000L
  398. #define MC_CT_UNITS_UNSIGNED 0x00030000L
  399. #define MC_CT_UNITS_DECIBELS 0x00040000L // in 10ths
  400. #define MC_CT_UNITS_PERCENT 0x00050000L // in 10ths
  401. //
  402. // MIXERCONTROL.dwControlType
  403. //
  404. //
  405. // Custom Controls
  406. //
  407. //
  408. #define MC_CONTROLTYPE_CUSTOM (MC_CT_CLASS_CUSTOM | MC_CT_UNITS_CUSTOM)
  409. //
  410. // Meters (Boolean)
  411. //
  412. // simply shows 'on or off' with the Boolean type
  413. //
  414. #define MC_CONTROLTYPE_BOOLEANMETER (MC_CT_CLASS_METER | MC_CT_SC_METER_POLLED | MC_CT_UNITS_BOOLEAN)
  415. //
  416. // Meters (signed)
  417. //
  418. // MIXERCONTROL.Bounds.lMinimum = min
  419. // MIXERCONTROL.Bounds.lMaximum = max
  420. //
  421. // signed meters are meant for displaying levels that have a signed nature.
  422. // there is no requirment for the values above and below zero to be
  423. // equal in magnitude. that is, it is 'ok' to have a range from, say, -3
  424. // to 12. however, the standard defined signed meter types may have
  425. // restrictions (such as the peakmeter).
  426. //
  427. // MC_CONTROLTYPE_PEAKMETER: a peak meter tells the monitoring
  428. // application the peak value reached (and phase) of a line (normally
  429. // wave input and output) over a small period of time. THIS IS NOT VU!
  430. // the bounds are fixed:
  431. //
  432. // MIXERCONTROL.Bounds.lMinimum = -32768 ALWAYS!
  433. // MIXERCONTROL.Bounds.lMaximum = 32767 ALWAYS!
  434. //
  435. // so 8 bit and 24 bit samples must be scaled appropriately. this is so
  436. // an application can display a 'bouncing blinky light' for a user and
  437. // also monitor a line for clipping. remember that 8 bit samples must
  438. // be converted to signed values (by the mixer driver)!
  439. //
  440. //
  441. // NOTE! meters are read only controls. also, a meter should only be
  442. // 'active' when the line it is associated with is active (see fdwLine
  443. // in MIXERLINE). it is NOT an error to read a meter that is not active--
  444. // the mixer driver should simply return 'no value' states (usually zero).
  445. // but it may be useful to stop monitoring a meter if the line is not
  446. // active...
  447. //
  448. #define MC_CONTROLTYPE_SIGNEDMETER (MC_CT_CLASS_METER | MC_CT_SC_METER_POLLED | MC_CT_UNITS_SIGNED)
  449. #define MC_CONTROLTYPE_PEAKMETER (MC_CONTROLTYPE_SIGNEDMETER + 1)
  450. //
  451. // Meters (unsigned)
  452. //
  453. // MIXERCONTROL.Bounds.dwMinimum = min
  454. // MIXERCONTROL.Bounds.dwMaximum = max
  455. //
  456. // unsigned meters are meant for displaying levels that have an unsigned
  457. // nature. there is no requirment for the values to be based at zero.
  458. // that is, it is 'ok' to have a range from, say, 8 to 42. however, the
  459. // standard defined unsigned meter types may have restrictions.
  460. //
  461. //
  462. // NOTE! meters are read only controls. also, a meter should only be
  463. // 'active' when the line it is associated with is active (see fdwLine
  464. // in MIXERLINE). it is NOT an error to read a meter that is not active--
  465. // the mixer driver should simply return 'no value' states (usually zero).
  466. // but it may be useful to stop monitoring a meter if the line is not
  467. // active...
  468. //
  469. #define MC_CONTROLTYPE_UNSIGNEDMETER (MC_CT_CLASS_METER | MC_CT_SC_METER_POLLED | MC_CT_UNITS_UNSIGNED)
  470. //
  471. // Switches (Boolean)
  472. //
  473. // MIXERCONTROL.Bounds.lMinimum = ignored (though should be zero)
  474. // MIXERCONTROL.Bounds.lMaximum = ignored (though should be one)
  475. //
  476. // Boolean switches are for enabling/disabling things. they are either
  477. // on (non-zero for fValue, 1 should be used) or off (zero for fValue).
  478. // a few standard types are defined in case an application wants to search
  479. // for a specific type of switch (like mute)--and also to allow a different
  480. // looking control to be used (say for ON/OFF vs a generic Boolean).
  481. //
  482. //
  483. #define MC_CONTROLTYPE_BOOLEAN (MC_CT_CLASS_SWITCH | MC_CT_SC_SWITCH_BOOLEAN | MC_CT_UNITS_BOOLEAN)
  484. #define MC_CONTROLTYPE_ONOFF (MC_CONTROLTYPE_BOOLEAN + 1)
  485. #define MC_CONTROLTYPE_MUTE (MC_CONTROLTYPE_BOOLEAN + 2)
  486. #define MC_CONTROLTYPE_MONO (MC_CONTROLTYPE_BOOLEAN + 3)
  487. #define MC_CONTROLTYPE_LOUDNESS (MC_CONTROLTYPE_BOOLEAN + 4)
  488. #define MC_CONTROLTYPE_STEREOENH (MC_CONTROLTYPE_BOOLEAN + 5)
  489. //
  490. // a button switch is 'write only' and simply signals the driver to do
  491. // something. an example is a 'Calibrate' button like the one in the
  492. // existing Turtle Beach MultiSound recording prep utility. an application
  493. // sets the fValue to TRUE for all buttons that should be pressed. if
  494. // fValue is FALSE, no action will be taken. reading a button's value will
  495. // always return FALSE (not depressed).
  496. //
  497. #define MC_CONTROLTYPE_BUTTON (MC_CT_CLASS_SWITCH | MC_CT_SC_SWITCH_BUTTON | MC_CT_UNITS_BOOLEAN)
  498. //
  499. // Number (signed integer)
  500. //
  501. //
  502. #define MC_CONTROLTYPE_SIGNED (MC_CT_CLASS_NUMBER | MC_CT_UNITS_SIGNED)
  503. //
  504. // the units are in 10ths of 1 decibel
  505. //
  506. //
  507. #define MC_CONTROLTYPE_DECIBELS (MC_CT_CLASS_NUMBER | MC_CT_UNITS_DECIBELS)
  508. //
  509. // Number (usigned integer)
  510. //
  511. //
  512. #define MC_CONTROLTYPE_UNSIGNED (MC_CT_CLASS_NUMBER | MC_CT_UNITS_UNSIGNED)
  513. //
  514. // the units are in 10ths of 1 percent
  515. //
  516. #define MC_CONTROLTYPE_PERCENT (MC_CT_CLASS_NUMBER | MC_CT_UNITS_PERCENT)
  517. //
  518. // Sliders (signed integer)
  519. //
  520. // sliders are meant 'positioning' type controls (such as panning).
  521. // the generic slider must have lMinimum, lMaximum, and cSteps filled
  522. // in--also note that there is no restriction on these values (see
  523. // signed meters above for more).
  524. //
  525. //
  526. // MC_CONTROLTYPE_PAN: this is meant to be a real simple pan
  527. // for stereo lines. the Bounds are fixed to be -32768 to 32767 with 0
  528. // being dead center. these values are LINEAR and there are no units
  529. // (-32768 = extreme left, 32767 = extreme right).
  530. //
  531. // if an application wants to display a scrollbar that does not contain
  532. // a bunch of 'dead space', then the scrollbar range should be set to
  533. // MIXERCONTROL.Metrics.cSteps and lValue should be scaled appropriately
  534. // with MulDiv.
  535. //
  536. // MIXERCONTROL.Bounds.lMinimum = -32768 ALWAYS!
  537. // MIXERCONTROL.Bounds.lMaximum = 32767 ALWAYS!
  538. // MIXERCONTROL.Metrics.cSteps = number of steps for range.
  539. //
  540. //
  541. // MC_CONTROLTYPE_QSOUNDPAN: the initial version of Q-Sound (tm,
  542. // etc by Archer Communications) defines 'Q-Space' as a sortof semi-circle
  543. // with 33 positions (0 = extreme left, 33 = extreme right, 16 = center).
  544. // in order to work with our 'slider position' concept, we shift these
  545. // values to -15 = extreme left, 15 = extreme right, 0 = center.
  546. //
  547. // MIXERCONTROL.Bounds.lMinimum = -15 ALWAYS!
  548. // MIXERCONTROL.Bounds.lMaximum = 15 ALWAYS!
  549. // MIXERCONTROL.Metrics.cSteps = 1 ALWAYS!
  550. //
  551. //
  552. #define MC_CONTROLTYPE_SLIDER (MC_CT_CLASS_SLIDER | MC_CT_UNITS_SIGNED)
  553. #define MC_CONTROLTYPE_PAN (MC_CONTROLTYPE_SLIDER + 1)
  554. #define MC_CONTROLTYPE_QSOUNDPAN (MC_CONTROLTYPE_SLIDER + 2)
  555. //
  556. // Simple Faders (unsigned integer)
  557. //
  558. // MIXERCONTROL.Bounds.dwMinimum = 0 ALWAYS!
  559. // MIXERCONTROL.Bounds.dwMaximum = 65535 ALWAYS!
  560. //
  561. // MIXERCONTROL.Metrics.cSteps = number of steps for range.
  562. //
  563. // these faders are meant to be as simple as possible for an application
  564. // to use. the Bounds are fixed to be 0 to 0xFFFF with 0x8000 being half
  565. // volume/level. these values are LINEAR and there are no units. 0 is
  566. // minimum volume/level, 0xFFFF is maximum.
  567. //
  568. // if an application wants to display a scrollbar that does not contain
  569. // a bunch of 'dead space', then the scrollbar range should be set to
  570. // MIXERCONTROL.Metrics.cSteps and dwValue should be scaled appropriately
  571. // with MulDiv.
  572. //
  573. #define MC_CONTROLTYPE_FADER (MC_CT_CLASS_FADER | MC_CT_UNITS_UNSIGNED)
  574. #define MC_CONTROLTYPE_VOLUME (MC_CONTROLTYPE_FADER + 1)
  575. #define MC_CONTROLTYPE_BASS (MC_CONTROLTYPE_FADER + 2)
  576. #define MC_CONTROLTYPE_TREBLE (MC_CONTROLTYPE_FADER + 3)
  577. #define MC_CONTROLTYPE_EQUALIZER (MC_CONTROLTYPE_FADER + 4)
  578. //
  579. // List (single select)
  580. //
  581. // MIXERCONTROL.cMultipleItems = number of items in list
  582. //
  583. // M_GCDSF_LISTTEXT should be used to get the text
  584. // for each item.
  585. //
  586. // MIXERCONTROLDETAILS_BOOLEAN should be used to set and retrieve
  587. // what item is selected (fValue = TRUE if selected).
  588. //
  589. // the generic single select lists can be used for many things. some
  590. // examples are 'Effects'. a mixer driver could provide a list of
  591. // different effects that could be applied like
  592. //
  593. // Reverbs: large hall, warm hall, bright plate, warehouse, etc.
  594. //
  595. // Delays: sweep delays, hold delays, 1.34 sec delay, etc.
  596. //
  597. // Vocal: recital hall, alcove, delay gate, etc
  598. //
  599. // lots of uses! gates, compressors, filters, dynamics, etc, etc.
  600. //
  601. //
  602. // MC_CONTROLTYPE_MUX: a 'Mux' is a single selection multiplexer.
  603. // usually a Mux is used to select, say, an input source for recording.
  604. // for example, a mixer driver might have a mux that lets the user select
  605. // between Microphone or Line-In (but not both!) for recording. this
  606. // would be a perfect place to use a Mux control. some cards (for example
  607. // Media Vision's 16 bit Pro Audio cards) can record from multiple sources
  608. // simultaneously, so they would use a MC_CONTROLTYPE_MIXER, not
  609. // a MC_CONTROLTYPE_MUX).
  610. //
  611. //
  612. // NOTE! because single select lists can change what selections are
  613. // possible based on other controls (uhg!), the application must examine
  614. // the fValue's of all items after setting the control details so the
  615. // display can be refreshed accordingly. an example might be that an
  616. // audio card cannot change its input source while recording--so the
  617. // selection would 'fail' by keeping the fValue on the current selection
  618. // (but mixerSetControlDetails will succeed!).
  619. //
  620. #define MC_CONTROLTYPE_SINGLESELECT (MC_CT_CLASS_LIST | MC_CT_SC_LIST_SINGLE | MC_CT_UNITS_BOOLEAN)
  621. #define MC_CONTROLTYPE_MUX (MC_CONTROLTYPE_SINGLESELECT + 1)
  622. //
  623. // List (multiple select)
  624. //
  625. // MIXERCONTROL.cMultipleItems = number of items in list
  626. //
  627. // M_GCDSF_LISTTEXT should be used to get the text
  628. // for each item.
  629. //
  630. // MIXERCONTROLDETAILS_BOOLEAN should be used to set and retrieve
  631. // what item(s) are selected (fValue = TRUE if selected).
  632. //
  633. // NOTE! because multiple select lists can change what selections are
  634. // selected based on other selections (uhg!), the application must examine
  635. // the fValue's of all items after setting the control details so the
  636. // display can be refreshed accordingly. an example might be that an
  637. // audio card cannot change its input source(s) while recording--so the
  638. // selection would 'fail' by keeping the fValue on the current selection(s)
  639. // (but mixerSetControlDetails will succeed!).
  640. //
  641. #define MC_CONTROLTYPE_MULTIPLESELECT (MC_CT_CLASS_LIST | MC_CT_SC_LIST_MULTIPLE | MC_CT_UNITS_BOOLEAN)
  642. #define MC_CONTROLTYPE_MIXER (MC_CONTROLTYPE_MULTIPLESELECT + 1)
  643. //
  644. // Time Controls
  645. //
  646. // MIXERCONTROL.Bounds.dwMinimum = min
  647. // MIXERCONTROL.Bounds.dwMaximum = max
  648. //
  649. // time controls are meant for inputing time information. these can be
  650. // used for effects such as delay, reverb, etc.
  651. //
  652. //
  653. #define MC_CONTROLTYPE_MICROTIME (MC_CT_CLASS_TIME | MC_CT_SC_TIME_MICROSECS | MC_CT_UNITS_UNSIGNED)
  654. #define MC_CONTROLTYPE_MILLITIME (MC_CT_CLASS_TIME | MC_CT_SC_TIME_MILLISECS | MC_CT_UNITS_UNSIGNED)
  655. //
  656. // MIXERLINECONTROLS
  657. //
  658. //
  659. //
  660. typedef struct tMIXERLINECONTROLS
  661. {
  662. DWORD cbStruct; // size in bytes of MIXERLINECONTROLS
  663. DWORD dwLineID; // line id (from MIXERLINE.dwLineID)
  664. union
  665. {
  666. DWORD dwControlID; // M_GLCONTROLSF_ONEBYID
  667. DWORD dwControlType; // M_GLCONTROLSF_ONEBYTYPE
  668. };
  669. DWORD cControls; // count of controls pmxctrl points to
  670. DWORD cbmxctrl; // size in bytes of _one_ MIXERCONTROL
  671. LPMIXERCONTROL pamxctrl; // pointer to first MIXERCONTROL array
  672. } MIXERLINECONTROLS;
  673. typedef MIXERLINECONTROLS *PMIXERLINECONTROLS;
  674. typedef MIXERLINECONTROLS FAR *LPMIXERLINECONTROLS;
  675. //
  676. //
  677. //
  678. MMRESULT MIXAPI mixerGetLineControls
  679. (
  680. HMIXEROBJ hmxobj,
  681. LPMIXERLINECONTROLS pmxlc,
  682. DWORD fdwControls
  683. );
  684. #define M_GLCONTROLSF_ALL 0x00000000L
  685. #define M_GLCONTROLSF_ONEBYID 0x00000001L
  686. #define M_GLCONTROLSF_ONEBYTYPE 0x00000002L
  687. #define M_GLCONTROLSF_QUERYMASK 0x0000000FL
  688. #define M_GLCONTROLSF_VALID (MIXER_OBJECTF_TYPEMASK | /* ;Internal */ \
  689. M_GLCONTROLSF_QUERYMASK) // ;Internal
  690. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  691. //
  692. // mixerGetControlDetails()
  693. //
  694. //
  695. //
  696. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  697. typedef struct tMIXERCONTROLDETAILS
  698. {
  699. DWORD cbStruct; // size in bytes of MIXERCONTROLDETAILS
  700. DWORD dwControlID; // control id to get/set details on
  701. DWORD cChannels; // number of channels in paDetails array
  702. union
  703. {
  704. HWND hwndOwner; // for M_SCDF_CUSTOM
  705. DWORD cMultipleItems; // if _MULTIPLE, the number of items per channel
  706. };
  707. DWORD cbDetails; // size of _one_ details_XX struct
  708. LPVOID paDetails; // pointer to array of details_XX structs
  709. } MIXERCONTROLDETAILS, *PMIXERCONTROLDETAILS, FAR *LPMIXERCONTROLDETAILS;
  710. //
  711. // M_GCDSF_LISTTEXT
  712. //
  713. //
  714. typedef struct tMIXERCONTROLDETAILS_LISTTEXT
  715. {
  716. DWORD dwParam1;
  717. DWORD dwParam2;
  718. char szName[MIXER_LONG_NAME_CHARS];
  719. } MIXERCONTROLDETAILS_LISTTEXT;
  720. typedef MIXERCONTROLDETAILS_LISTTEXT *PMIXERCONTROLDETAILS_LISTTEXT;
  721. typedef MIXERCONTROLDETAILS_LISTTEXT FAR *LPMIXERCONTROLDETAILS_LISTTEXT;
  722. //
  723. // M_GCDSF_VALUE
  724. //
  725. //
  726. typedef struct tMIXERCONTROLDETAILS_BOOLEAN
  727. {
  728. LONG fValue;
  729. } MIXERCONTROLDETAILS_BOOLEAN,
  730. *PMIXERCONTROLDETAILS_BOOLEAN,
  731. FAR *LPMIXERCONTROLDETAILS_BOOLEAN;
  732. typedef struct tMIXERCONTROLDETAILS_SIGNED
  733. {
  734. LONG lValue;
  735. } MIXERCONTROLDETAILS_SIGNED,
  736. *PMIXERCONTROLDETAILS_SIGNED,
  737. FAR *LPMIXERCONTROLDETAILS_SIGNED;
  738. typedef struct tMIXERCONTROLDETAILS_UNSIGNED
  739. {
  740. DWORD dwValue;
  741. } MIXERCONTROLDETAILS_UNSIGNED,
  742. *PMIXERCONTROLDETAILS_UNSIGNED,
  743. FAR *LPMIXERCONTROLDETAILS_UNSIGNED;
  744. //
  745. //
  746. //
  747. //
  748. MMRESULT MIXAPI mixerGetControlDetails
  749. (
  750. HMIXEROBJ hmxobj,
  751. LPMIXERCONTROLDETAILS pmxcd,
  752. DWORD fdwDetails
  753. );
  754. #define M_GCDSF_VALUE 0x00000000L
  755. #define M_GCDSF_LISTTEXT 0x00000001L
  756. #define M_GCDSF_QUERYMASK 0x0000000FL
  757. #define M_GCDSF_VALID (MIXER_OBJECTF_TYPEMASK | /* ;Internal */ \
  758. M_GCDSF_QUERYMASK) /* ;Internal */
  759. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  760. //
  761. // mixerSetControlDetails()
  762. //
  763. //
  764. //- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ;
  765. MMRESULT MIXAPI mixerSetControlDetails
  766. (
  767. HMIXEROBJ hmxobj,
  768. LPMIXERCONTROLDETAILS pmxcd,
  769. DWORD fdwDetails
  770. );
  771. #define M_SCDF_VALUE 0x00000000L
  772. #define M_SCDF_CUSTOM 0x00000001L
  773. #define M_SCDF_QUERYMASK 0x0000000FL
  774. #define M_SCDF_VALID (MIXER_OBJECTF_TYPEMASK | /* ;Internal */ \
  775. M_SCDF_QUERYMASK) /* ;Internal */
  776. #endif // MM_MIXM_LINE_CHANGE
  777. #endif // MMNOMIXER
  778. #endif // _INC_MMSYSTEM
  779. //==========================================================================;
  780. //
  781. // Mixer Driver Definitions
  782. //
  783. //
  784. //
  785. //==========================================================================;
  786. #ifdef _INC_MMDDK
  787. #ifndef MMNOMIXERDEV
  788. #ifndef MAXMIXERDRIVERS
  789. //
  790. // maximum number of mixer drivers that can be loaded by MSMIXMGR.DLL
  791. //
  792. #define MAXMIXERDRIVERS 10
  793. //
  794. // mixer device open information structure
  795. //
  796. //
  797. typedef struct tMIXEROPENDESC
  798. {
  799. HMIXER hmx; // handle that will be used
  800. LPVOID pReserved0; // reserved--driver should ignore
  801. DWORD dwCallback; // callback
  802. DWORD dwInstance; // app's private instance information
  803. } MIXEROPENDESC, *PMIXEROPENDESC, FAR *LPMIXEROPENDESC;
  804. //
  805. //
  806. //
  807. //
  808. #define MXDM_INIT 100
  809. #define MXDM_USER DRV_USER
  810. #define MXDM_BASE (1)
  811. #define MXDM_GETNUMDEVS (MXDM_BASE + 0)
  812. #define MXDM_GETDEVCAPS (MXDM_BASE + 1)
  813. #define MXDM_OPEN (MXDM_BASE + 2)
  814. #define MXDM_CLOSE (MXDM_BASE + 3)
  815. #define MXDM_GETLINEINFO (MXDM_BASE + 4)
  816. #define MXDM_GETLINECONTROLS (MXDM_BASE + 5)
  817. #define MXDM_GETCONTROLDETAILS (MXDM_BASE + 6)
  818. #define MXDM_SETCONTROLDETAILS (MXDM_BASE + 7)
  819. #endif // MAXMIXERDRIVERS
  820. #endif // MMNOMIXERDEV
  821. #endif // _INC_MMDDK
  822. #ifdef __cplusplus
  823. } // end of extern "C" {
  824. #endif // __cplusplus
  825. #ifndef RC_INVOKED
  826. #pragma pack() // revert to default packing
  827. #endif
  828. #endif // _INC_MSMIXMGR