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.

1891 lines
50 KiB

  1. //==========================================================================;
  2. //
  3. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  4. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
  5. // TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR
  6. // A PARTICULAR PURPOSE.
  7. //
  8. // Copyright (C) 1993 - 1995 Microsoft Corporation. All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11. //
  12. // lowlevel.c
  13. //
  14. // Description:
  15. //
  16. //
  17. // History:
  18. // 5/16/93
  19. //
  20. //==========================================================================;
  21. #include <windows.h>
  22. #include <windowsx.h>
  23. #include <mmsystem.h>
  24. //#include "msmixmgr.h"
  25. #include "appport.h"
  26. #include "mmcaps.h"
  27. #include "debug.h"
  28. //
  29. //
  30. //
  31. TCHAR gszDeviceFormatTitle[] = TEXT("Type\t8!Index\t5!Version\t7!Product Name");
  32. TCHAR gszDeviceFormatList[] = TEXT("%-9s\t%d\t%u.%.02u\t%-32s");
  33. //
  34. //
  35. //
  36. //
  37. TCHAR gszBogusCaps[] = TEXT("????");
  38. TCHAR gszTimerDevice[] = TEXT("Internal PC Timer");
  39. TCHAR gszDefaultMapper[] = TEXT("Default Mapper");
  40. #define MMCAPS_DEVTYPE_UNKNOWN 0
  41. #define MMCAPS_DEVTYPE_AUXILIARY 1
  42. #define MMCAPS_DEVTYPE_JOYSTICK 2
  43. #define MMCAPS_DEVTYPE_MIDIIN 3
  44. #define MMCAPS_DEVTYPE_MIDIOUT 4
  45. #define MMCAPS_DEVTYPE_MIXER 5
  46. #define MMCAPS_DEVTYPE_TIMER 6
  47. #define MMCAPS_DEVTYPE_WAVEIN 7
  48. #define MMCAPS_DEVTYPE_WAVEOUT 8
  49. PTSTR gaszDeviceType[] =
  50. {
  51. gszUnknown,
  52. TEXT("Auxiliary"),
  53. TEXT("Joystick"),
  54. TEXT("MIDI In"),
  55. TEXT("MIDI Out"),
  56. TEXT("Mixer"),
  57. TEXT("Timer"),
  58. TEXT("Wave In"),
  59. TEXT("Wave Out")
  60. };
  61. //
  62. // AUXCAPS
  63. //
  64. //
  65. //
  66. PTSTR gaszAuxCapsTechnology[] =
  67. {
  68. gszNotSpecified, //
  69. TEXT("CD-Audio"), // AUXCAPS_CDAUDIO
  70. TEXT("Auxiliary Input") // AUXCAPS_AUXIN
  71. };
  72. #define AUXCAPS_TECHNOLOGY_LAST AUXCAPS_AUXIN
  73. PTSTR gaszAuxCapsSupport[32] =
  74. {
  75. TEXT("Volume"), // Bit 0 AUXCAPS_VOLUME
  76. TEXT("L/R Volume"), // Bit 1 AUXCAPS_LRVOLUME
  77. NULL, // Bit 2
  78. NULL, // Bit 3
  79. NULL, // Bit 4
  80. NULL, // Bit 5
  81. NULL, // Bit 6
  82. NULL, // Bit 7
  83. NULL, // Bit 8
  84. NULL, // Bit 9
  85. NULL, // Bit 10
  86. NULL, // Bit 11
  87. NULL, // Bit 12
  88. NULL, // Bit 13
  89. NULL, // Bit 14
  90. NULL, // Bit 15
  91. NULL, // Bit 16
  92. NULL, // Bit 17
  93. NULL, // Bit 18
  94. NULL, // Bit 19
  95. NULL, // Bit 20
  96. NULL, // Bit 21
  97. NULL, // Bit 22
  98. NULL, // Bit 23
  99. NULL, // Bit 24
  100. NULL, // Bit 25
  101. NULL, // Bit 26
  102. NULL, // Bit 27
  103. NULL, // Bit 28
  104. NULL, // Bit 29
  105. NULL, // Bit 30
  106. NULL // Bit 31
  107. };
  108. //
  109. // MIDI[IN|OUT]CAPS
  110. //
  111. //
  112. //
  113. PTSTR gaszMidiOutCapsTechnology[] =
  114. {
  115. gszNotSpecified,
  116. TEXT("MIDI Port"), // MOD_MIDIPORT
  117. TEXT("Internal Synth"), // MOD_SYNTH
  118. TEXT("Internal Square Wave Synth"), // MOD_SQSYNTH
  119. TEXT("Internal FM Synth"), // MOD_FMSYNTH
  120. TEXT("MIDI Mapper") // MOD_MAPPER
  121. };
  122. #define MIDIOUTCAPS_TECHNOLOGY_LAST MOD_MAPPER
  123. PTSTR gaszMidiOutCapsSupport[32] =
  124. {
  125. TEXT("Volume"), // Bit 0 MIDICAPS_VOLUME
  126. TEXT("L/R Volume"), // Bit 1 MIDICAPS_LRVOLUME
  127. TEXT("Patch Caching"), // Bit 2 MIDICAPS_CACHE
  128. TEXT("Poly Message"), // Bit 3 MIDICAPS_POLYMSG (Win 4)
  129. NULL, // Bit 4
  130. NULL, // Bit 5
  131. NULL, // Bit 6
  132. NULL, // Bit 7
  133. NULL, // Bit 8
  134. NULL, // Bit 9
  135. NULL, // Bit 10
  136. NULL, // Bit 11
  137. NULL, // Bit 12
  138. NULL, // Bit 13
  139. NULL, // Bit 14
  140. NULL, // Bit 15
  141. NULL, // Bit 16
  142. NULL, // Bit 17
  143. NULL, // Bit 18
  144. NULL, // Bit 19
  145. NULL, // Bit 20
  146. NULL, // Bit 21
  147. NULL, // Bit 22
  148. NULL, // Bit 23
  149. NULL, // Bit 24
  150. NULL, // Bit 25
  151. NULL, // Bit 26
  152. NULL, // Bit 27
  153. NULL, // Bit 28
  154. NULL, // Bit 29
  155. NULL, // Bit 30
  156. NULL // Bit 31
  157. };
  158. //
  159. // MIXERCAPS
  160. //
  161. //
  162. //
  163. PTSTR gaszMixerCapsSupport[32] =
  164. {
  165. NULL, // Bit 0
  166. NULL, // Bit 1
  167. NULL, // Bit 2
  168. NULL, // Bit 3
  169. NULL, // Bit 4
  170. NULL, // Bit 5
  171. NULL, // Bit 6
  172. NULL, // Bit 7
  173. NULL, // Bit 8
  174. NULL, // Bit 9
  175. NULL, // Bit 10
  176. NULL, // Bit 11
  177. NULL, // Bit 12
  178. NULL, // Bit 13
  179. NULL, // Bit 14
  180. NULL, // Bit 15
  181. NULL, // Bit 16
  182. NULL, // Bit 17
  183. NULL, // Bit 18
  184. NULL, // Bit 19
  185. NULL, // Bit 20
  186. NULL, // Bit 21
  187. NULL, // Bit 22
  188. NULL, // Bit 23
  189. NULL, // Bit 24
  190. NULL, // Bit 25
  191. NULL, // Bit 26
  192. NULL, // Bit 27
  193. NULL, // Bit 28
  194. NULL, // Bit 29
  195. NULL, // Bit 30
  196. NULL // Bit 31
  197. };
  198. //
  199. // WAVE[IN|OUT]CAPS
  200. //
  201. //
  202. //
  203. PTSTR gaszWaveInOutCapsFormats[32] =
  204. {
  205. TEXT("8M11"), // Bit 0 WAVE_FORMAT_1M08
  206. TEXT("8S11"), // Bit 1 WAVE_FORMAT_1S08
  207. TEXT("16M11"), // Bit 2 WAVE_FORMAT_1M16
  208. TEXT("16S11"), // Bit 3 WAVE_FORMAT_1S16
  209. TEXT("8M22"), // Bit 4 WAVE_FORMAT_2M08
  210. TEXT("8S22"), // Bit 5 WAVE_FORMAT_2S08
  211. TEXT("16M22"), // Bit 6 WAVE_FORMAT_2M16
  212. TEXT("16S22"), // Bit 7 WAVE_FORMAT_2S16
  213. TEXT("8M44"), // Bit 8 WAVE_FORMAT_4M08
  214. TEXT("8S44"), // Bit 9 WAVE_FORMAT_4S08
  215. TEXT("16M44"), // Bit 10 WAVE_FORMAT_4M16
  216. TEXT("16S44"), // Bit 11 WAVE_FORMAT_4S16
  217. NULL, // Bit 12
  218. NULL, // Bit 13
  219. NULL, // Bit 14
  220. NULL, // Bit 15
  221. NULL, // Bit 16
  222. NULL, // Bit 17
  223. NULL, // Bit 18
  224. NULL, // Bit 19
  225. NULL, // Bit 20
  226. NULL, // Bit 21
  227. NULL, // Bit 22
  228. NULL, // Bit 23
  229. NULL, // Bit 24
  230. NULL, // Bit 25
  231. NULL, // Bit 26
  232. NULL, // Bit 27
  233. NULL, // Bit 28
  234. NULL, // Bit 29
  235. NULL, // Bit 30
  236. NULL // Bit 31
  237. };
  238. PTSTR gaszWaveOutCapsSupport[32] =
  239. {
  240. TEXT("Pitch"), // Bit 0 WAVECAPS_PITCH
  241. TEXT("Playback Rate"), // Bit 1 WAVECAPS_PLAYBACKRATE
  242. TEXT("Volume"), // Bit 2 WAVECAPS_VOLUME
  243. TEXT("L/R Volume"), // Bit 3 WAVECAPS_LRVOLUME
  244. TEXT("Sync"), // Bit 4 WAVECAPS_SYNC
  245. NULL, // Bit 5
  246. NULL, // Bit 6
  247. NULL, // Bit 7
  248. NULL, // Bit 8
  249. NULL, // Bit 9
  250. NULL, // Bit 10
  251. NULL, // Bit 11
  252. NULL, // Bit 12
  253. NULL, // Bit 13
  254. NULL, // Bit 14
  255. NULL, // Bit 15
  256. NULL, // Bit 16
  257. NULL, // Bit 17
  258. NULL, // Bit 18
  259. NULL, // Bit 19
  260. NULL, // Bit 20
  261. NULL, // Bit 21
  262. NULL, // Bit 22
  263. NULL, // Bit 23
  264. NULL, // Bit 24
  265. NULL, // Bit 25
  266. NULL, // Bit 26
  267. NULL, // Bit 27
  268. NULL, // Bit 28
  269. NULL, // Bit 29
  270. NULL, // Bit 30
  271. NULL // Bit 31
  272. };
  273. //==========================================================================;
  274. //
  275. //
  276. //
  277. //
  278. //==========================================================================;
  279. //--------------------------------------------------------------------------;
  280. //
  281. // BOOL MMCapsDetailAuxiliary
  282. //
  283. // Description:
  284. //
  285. //
  286. // Arguments:
  287. // HWND hedit:
  288. //
  289. // int nDevId:
  290. //
  291. // Return (BOOL):
  292. //
  293. // History:
  294. // 05/11/93
  295. //
  296. //--------------------------------------------------------------------------;
  297. BOOL FNLOCAL MMCapsDetailAuxiliary
  298. (
  299. HWND hedit,
  300. int nDevId
  301. )
  302. {
  303. TCHAR ach[MMCAPS_MAX_STRING_MIDPID_CHARS];
  304. PSTR psz;
  305. MMRESULT mmr;
  306. AUXCAPS2 ac2;
  307. UINT u;
  308. DWORD dw;
  309. AppMEditPrintF(hedit, " Device Type: %s\r\n",
  310. (LPSTR)gaszDeviceType[MMCAPS_DEVTYPE_AUXILIARY]);
  311. if (-1 == nDevId)
  312. AppMEditPrintF(hedit, " Index (Id): %d (Mapper)\r\n", nDevId);
  313. else
  314. AppMEditPrintF(hedit, " Index (Id): %d\r\n", nDevId);
  315. _fmemset(&ac2, 0, sizeof(ac2));
  316. mmr = auxGetDevCaps(nDevId, (PAUXCAPS)&ac2, sizeof(ac2));
  317. if (MMSYSERR_NOERROR != mmr)
  318. {
  319. _fmemset(&ac2, 0, sizeof(ac2));
  320. if (-1 != nDevId)
  321. {
  322. lstrcpy(ac2.szPname, gszBogusCaps);
  323. }
  324. else
  325. {
  326. if (0 != auxGetNumDevs())
  327. {
  328. ac2.wMid = MM_MICROSOFT;
  329. ac2.vDriverVersion = (MMVERSION)GetVersion();
  330. lstrcpy(ac2.szPname, gszDefaultMapper);
  331. mmr = MMSYSERR_NOERROR;
  332. }
  333. }
  334. }
  335. AppMEditPrintF(hedit, " Product Name: %s\r\n", (LPSTR)ac2.szPname);
  336. if (MMSYSERR_NOERROR != mmr)
  337. {
  338. return (TRUE);
  339. }
  340. //
  341. //
  342. //
  343. //
  344. AppMEditPrintF(hedit, " Name GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  345. ac2.NameGuid.Data1,
  346. ac2.NameGuid.Data2,
  347. ac2.NameGuid.Data3,
  348. ac2.NameGuid.Data4[0],
  349. ac2.NameGuid.Data4[1],
  350. ac2.NameGuid.Data4[2],
  351. ac2.NameGuid.Data4[3],
  352. ac2.NameGuid.Data4[4],
  353. ac2.NameGuid.Data4[5],
  354. ac2.NameGuid.Data4[6],
  355. ac2.NameGuid.Data4[7]);
  356. //
  357. //
  358. //
  359. //
  360. MMCapsMidAndPid(ac2.wMid, ach, 0, NULL);
  361. AppMEditPrintF(hedit, " Manufacturer Id: %s\r\n", (LPSTR)ach);
  362. AppMEditPrintF(hedit, " Manufacturer GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  363. ac2.ManufacturerGuid.Data1,
  364. ac2.ManufacturerGuid.Data2,
  365. ac2.ManufacturerGuid.Data3,
  366. ac2.ManufacturerGuid.Data4[0],
  367. ac2.ManufacturerGuid.Data4[1],
  368. ac2.ManufacturerGuid.Data4[2],
  369. ac2.ManufacturerGuid.Data4[3],
  370. ac2.ManufacturerGuid.Data4[4],
  371. ac2.ManufacturerGuid.Data4[5],
  372. ac2.ManufacturerGuid.Data4[6],
  373. ac2.ManufacturerGuid.Data4[7]);
  374. MMCapsMidAndPid(ac2.wMid, NULL, ac2.wPid, ach);
  375. AppMEditPrintF(hedit, " Product Id: %s\r\n", (LPSTR)ach);
  376. AppMEditPrintF(hedit, " Product GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  377. ac2.ProductGuid.Data1,
  378. ac2.ProductGuid.Data2,
  379. ac2.ProductGuid.Data3,
  380. ac2.ProductGuid.Data4[0],
  381. ac2.ProductGuid.Data4[1],
  382. ac2.ProductGuid.Data4[2],
  383. ac2.ProductGuid.Data4[3],
  384. ac2.ProductGuid.Data4[4],
  385. ac2.ProductGuid.Data4[5],
  386. ac2.ProductGuid.Data4[6],
  387. ac2.ProductGuid.Data4[7]);
  388. AppMEditPrintF(hedit, " Driver Version: %u.%.02u\r\n",
  389. (ac2.vDriverVersion >> 8), (BYTE)ac2.vDriverVersion);
  390. if (ac2.wTechnology > AUXCAPS_TECHNOLOGY_LAST)
  391. {
  392. wsprintf(ach, "[%u], Unknown", ac2.wTechnology);
  393. psz = ach;
  394. }
  395. else
  396. {
  397. psz = gaszAuxCapsTechnology[ac2.wTechnology];
  398. }
  399. AppMEditPrintF(hedit, " Technology: %s\r\n", (LPSTR)psz);
  400. //
  401. //
  402. //
  403. //
  404. AppMEditPrintF(hedit, " Standard Support: [%.08lXh]", ac2.dwSupport);
  405. for (u = 0, dw = ac2.dwSupport; dw; u++)
  406. {
  407. if ((BYTE)dw & (BYTE)1)
  408. {
  409. psz = gaszAuxCapsSupport[u];
  410. if (NULL == psz)
  411. {
  412. wsprintf(ach, "Unknown%u", u);
  413. psz = ach;
  414. }
  415. AppMEditPrintF(hedit, ", %s", (LPSTR)psz);
  416. }
  417. dw >>= 1;
  418. }
  419. AppMEditPrintF(hedit, "\r\n");
  420. return (TRUE);
  421. } // MMCapsDetailAuxiliary()
  422. //--------------------------------------------------------------------------;
  423. //
  424. // BOOL MMCapsDetailJoystick
  425. //
  426. // Description:
  427. //
  428. //
  429. // Arguments:
  430. // HWND hedit:
  431. //
  432. // int nDevId:
  433. //
  434. // Return (BOOL):
  435. //
  436. // History:
  437. // 05/11/93
  438. //
  439. //--------------------------------------------------------------------------;
  440. BOOL FNLOCAL MMCapsDetailJoystick
  441. (
  442. HWND hedit,
  443. int nDevId
  444. )
  445. {
  446. TCHAR ach[MMCAPS_MAX_STRING_MIDPID_CHARS];
  447. MMRESULT mmr;
  448. JOYCAPS2 jc2;
  449. AppMEditPrintF(hedit, " Device Type: %s\r\n",
  450. (LPSTR)gaszDeviceType[MMCAPS_DEVTYPE_JOYSTICK]);
  451. AppMEditPrintF(hedit, " Index (Id): %d\r\n", nDevId);
  452. //
  453. //
  454. //
  455. _fmemset(&jc2, 0, sizeof(jc2));
  456. mmr = joyGetDevCaps(nDevId, (PJOYCAPS)&jc2, sizeof(jc2));
  457. if (MMSYSERR_NOERROR != mmr)
  458. {
  459. lstrcpy(jc2.szPname, gszBogusCaps);
  460. }
  461. AppMEditPrintF(hedit, " Product Name: %s\r\n", (LPSTR)jc2.szPname);
  462. if (MMSYSERR_NOERROR != mmr)
  463. {
  464. return (TRUE);
  465. }
  466. AppMEditPrintF(hedit, " Name GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  467. jc2.NameGuid.Data1,
  468. jc2.NameGuid.Data2,
  469. jc2.NameGuid.Data3,
  470. jc2.NameGuid.Data4[0],
  471. jc2.NameGuid.Data4[1],
  472. jc2.NameGuid.Data4[2],
  473. jc2.NameGuid.Data4[3],
  474. jc2.NameGuid.Data4[4],
  475. jc2.NameGuid.Data4[5],
  476. jc2.NameGuid.Data4[6],
  477. jc2.NameGuid.Data4[7]);
  478. //
  479. //
  480. //
  481. //
  482. MMCapsMidAndPid(jc2.wMid, ach, 0, NULL);
  483. AppMEditPrintF(hedit, " Manufacturer Id: %s\r\n", (LPSTR)ach);
  484. AppMEditPrintF(hedit, " Manufacturer GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  485. jc2.ManufacturerGuid.Data1,
  486. jc2.ManufacturerGuid.Data2,
  487. jc2.ManufacturerGuid.Data3,
  488. jc2.ManufacturerGuid.Data4[0],
  489. jc2.ManufacturerGuid.Data4[1],
  490. jc2.ManufacturerGuid.Data4[2],
  491. jc2.ManufacturerGuid.Data4[3],
  492. jc2.ManufacturerGuid.Data4[4],
  493. jc2.ManufacturerGuid.Data4[5],
  494. jc2.ManufacturerGuid.Data4[6],
  495. jc2.ManufacturerGuid.Data4[7]);
  496. MMCapsMidAndPid(jc2.wMid, NULL, jc2.wPid, ach);
  497. AppMEditPrintF(hedit, " Product Id: %s\r\n", (LPSTR)ach);
  498. AppMEditPrintF(hedit, " Product GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  499. jc2.ProductGuid.Data1,
  500. jc2.ProductGuid.Data2,
  501. jc2.ProductGuid.Data3,
  502. jc2.ProductGuid.Data4[0],
  503. jc2.ProductGuid.Data4[1],
  504. jc2.ProductGuid.Data4[2],
  505. jc2.ProductGuid.Data4[3],
  506. jc2.ProductGuid.Data4[4],
  507. jc2.ProductGuid.Data4[5],
  508. jc2.ProductGuid.Data4[6],
  509. jc2.ProductGuid.Data4[7]);
  510. AppMEditPrintF(hedit, " Driver Version: (sigh)\r\n");
  511. AppMEditPrintF(hedit, " Buttons: %u\r\n", jc2.wNumButtons);
  512. AppMEditPrintF(hedit, " Minimum X Pos: %u\r\n", jc2.wXmin);
  513. AppMEditPrintF(hedit, " Maximum X Pos: %u\r\n", jc2.wXmax);
  514. AppMEditPrintF(hedit, " Minimum Y Pos: %u\r\n", jc2.wYmin);
  515. AppMEditPrintF(hedit, " Maximum Y Pos: %u\r\n", jc2.wYmax);
  516. AppMEditPrintF(hedit, " Minimum Z Pos: %u\r\n", jc2.wZmin);
  517. AppMEditPrintF(hedit, " Maximum Z Pos: %u\r\n", jc2.wZmax);
  518. AppMEditPrintF(hedit, " Minimum Period: %u\r\n", jc2.wPeriodMin);
  519. AppMEditPrintF(hedit, " Maximum Period: %u\r\n", jc2.wPeriodMax);
  520. return (TRUE);
  521. } // MMCapsDetailJoystick()
  522. //--------------------------------------------------------------------------;
  523. //
  524. // BOOL MMCapsDetailMidiIn
  525. //
  526. // Description:
  527. //
  528. //
  529. // Arguments:
  530. // HWND hedit:
  531. //
  532. // int nDevId:
  533. //
  534. // Return (BOOL):
  535. //
  536. // History:
  537. // 05/11/93
  538. //
  539. //--------------------------------------------------------------------------;
  540. BOOL FNLOCAL MMCapsDetailMidiIn
  541. (
  542. HWND hedit,
  543. int nDevId
  544. )
  545. {
  546. TCHAR ach[MMCAPS_MAX_STRING_MIDPID_CHARS];
  547. MMRESULT mmr;
  548. MIDIINCAPS2 mic2;
  549. AppMEditPrintF(hedit, " Device Type: %s\r\n",
  550. (LPSTR)gaszDeviceType[MMCAPS_DEVTYPE_MIDIIN]);
  551. if (-1 == nDevId)
  552. AppMEditPrintF(hedit, " Index (Id): %d (Mapper)\r\n", nDevId);
  553. else
  554. AppMEditPrintF(hedit, " Index (Id): %d\r\n", nDevId);
  555. //
  556. //
  557. //
  558. _fmemset(&mic2, 0, sizeof(mic2));
  559. mmr = midiInGetDevCaps(nDevId, (PMIDIINCAPS)&mic2, sizeof(mic2));
  560. if (MMSYSERR_NOERROR != mmr)
  561. {
  562. _fmemset(&mic2, 0, sizeof(mic2));
  563. if (-1 != nDevId)
  564. {
  565. lstrcpy(mic2.szPname, gszBogusCaps);
  566. }
  567. else
  568. {
  569. if (0 != midiInGetNumDevs())
  570. {
  571. mic2.wMid = MM_MICROSOFT;
  572. mic2.vDriverVersion = (MMVERSION)GetVersion();
  573. lstrcpy(mic2.szPname, gszDefaultMapper);
  574. mmr = MMSYSERR_NOERROR;
  575. }
  576. }
  577. }
  578. AppMEditPrintF(hedit, " Product Name: %s\r\n", (LPSTR)mic2.szPname);
  579. if (MMSYSERR_NOERROR != mmr)
  580. {
  581. return (TRUE);
  582. }
  583. //
  584. //
  585. //
  586. //
  587. AppMEditPrintF(hedit, " Name GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  588. mic2.NameGuid.Data1,
  589. mic2.NameGuid.Data2,
  590. mic2.NameGuid.Data3,
  591. mic2.NameGuid.Data4[0],
  592. mic2.NameGuid.Data4[1],
  593. mic2.NameGuid.Data4[2],
  594. mic2.NameGuid.Data4[3],
  595. mic2.NameGuid.Data4[4],
  596. mic2.NameGuid.Data4[5],
  597. mic2.NameGuid.Data4[6],
  598. mic2.NameGuid.Data4[7]);
  599. //
  600. //
  601. //
  602. //
  603. MMCapsMidAndPid(mic2.wMid, ach, 0, NULL);
  604. AppMEditPrintF(hedit, " Manufacturer Id: %s\r\n", (LPSTR)ach);
  605. AppMEditPrintF(hedit, " Manufacturer GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  606. mic2.ManufacturerGuid.Data1,
  607. mic2.ManufacturerGuid.Data2,
  608. mic2.ManufacturerGuid.Data3,
  609. mic2.ManufacturerGuid.Data4[0],
  610. mic2.ManufacturerGuid.Data4[1],
  611. mic2.ManufacturerGuid.Data4[2],
  612. mic2.ManufacturerGuid.Data4[3],
  613. mic2.ManufacturerGuid.Data4[4],
  614. mic2.ManufacturerGuid.Data4[5],
  615. mic2.ManufacturerGuid.Data4[6],
  616. mic2.ManufacturerGuid.Data4[7]);
  617. MMCapsMidAndPid(mic2.wMid, NULL, mic2.wPid, ach);
  618. AppMEditPrintF(hedit, " Product Id: %s\r\n", (LPSTR)ach);
  619. AppMEditPrintF(hedit, " Product GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  620. mic2.ProductGuid.Data1,
  621. mic2.ProductGuid.Data2,
  622. mic2.ProductGuid.Data3,
  623. mic2.ProductGuid.Data4[0],
  624. mic2.ProductGuid.Data4[1],
  625. mic2.ProductGuid.Data4[2],
  626. mic2.ProductGuid.Data4[3],
  627. mic2.ProductGuid.Data4[4],
  628. mic2.ProductGuid.Data4[5],
  629. mic2.ProductGuid.Data4[6],
  630. mic2.ProductGuid.Data4[7]);
  631. AppMEditPrintF(hedit, " Driver Version: %u.%.02u\r\n",
  632. (mic2.vDriverVersion >> 8), (BYTE)mic2.vDriverVersion);
  633. return (TRUE);
  634. } // MMCapsDetailMidiIn()
  635. //--------------------------------------------------------------------------;
  636. //
  637. // BOOL MMCapsDetailMidiOut
  638. //
  639. // Description:
  640. //
  641. //
  642. // Arguments:
  643. // HWND hedit:
  644. //
  645. // int nDevId:
  646. //
  647. // Return (BOOL):
  648. //
  649. // History:
  650. // 05/11/93
  651. //
  652. //--------------------------------------------------------------------------;
  653. BOOL FNLOCAL MMCapsDetailMidiOut
  654. (
  655. HWND hedit,
  656. int nDevId
  657. )
  658. {
  659. TCHAR ach[MMCAPS_MAX_STRING_MIDPID_CHARS];
  660. PSTR psz;
  661. MMRESULT mmr;
  662. MIDIOUTCAPS2 moc2;
  663. UINT u;
  664. DWORD dw;
  665. AppMEditPrintF(hedit, " Device Type: %s\r\n",
  666. (LPSTR)gaszDeviceType[MMCAPS_DEVTYPE_MIDIOUT]);
  667. if (-1 == nDevId)
  668. AppMEditPrintF(hedit, " Index (Id): %d (Mapper)\r\n", nDevId);
  669. else
  670. AppMEditPrintF(hedit, " Index (Id): %d\r\n", nDevId);
  671. //
  672. //
  673. //
  674. _fmemset(&moc2, 0, sizeof(moc2));
  675. mmr = midiOutGetDevCaps(nDevId, (PMIDIOUTCAPS)&moc2, sizeof(moc2));
  676. if (MMSYSERR_NOERROR != mmr)
  677. {
  678. _fmemset(&moc2, 0, sizeof(moc2));
  679. if (-1 != nDevId)
  680. {
  681. lstrcpy(moc2.szPname, gszBogusCaps);
  682. }
  683. else
  684. {
  685. if (0 != midiOutGetNumDevs())
  686. {
  687. moc2.wMid = MM_MICROSOFT;
  688. moc2.vDriverVersion = (MMVERSION)GetVersion();
  689. lstrcpy(moc2.szPname, gszDefaultMapper);
  690. mmr = MMSYSERR_NOERROR;
  691. }
  692. }
  693. }
  694. AppMEditPrintF(hedit, " Product Name: %s\r\n", (LPSTR)moc2.szPname);
  695. if (MMSYSERR_NOERROR != mmr)
  696. {
  697. return (TRUE);
  698. }
  699. //
  700. //
  701. //
  702. //
  703. AppMEditPrintF(hedit, " Name GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  704. moc2.NameGuid.Data1,
  705. moc2.NameGuid.Data2,
  706. moc2.NameGuid.Data3,
  707. moc2.NameGuid.Data4[0],
  708. moc2.NameGuid.Data4[1],
  709. moc2.NameGuid.Data4[2],
  710. moc2.NameGuid.Data4[3],
  711. moc2.NameGuid.Data4[4],
  712. moc2.NameGuid.Data4[5],
  713. moc2.NameGuid.Data4[6],
  714. moc2.NameGuid.Data4[7]);
  715. //
  716. //
  717. //
  718. //
  719. MMCapsMidAndPid(moc2.wMid, ach, 0, NULL);
  720. AppMEditPrintF(hedit, " Manufacturer Id: %s\r\n", (LPSTR)ach);
  721. AppMEditPrintF(hedit, " Manufacturer GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  722. moc2.ManufacturerGuid.Data1,
  723. moc2.ManufacturerGuid.Data2,
  724. moc2.ManufacturerGuid.Data3,
  725. moc2.ManufacturerGuid.Data4[0],
  726. moc2.ManufacturerGuid.Data4[1],
  727. moc2.ManufacturerGuid.Data4[2],
  728. moc2.ManufacturerGuid.Data4[3],
  729. moc2.ManufacturerGuid.Data4[4],
  730. moc2.ManufacturerGuid.Data4[5],
  731. moc2.ManufacturerGuid.Data4[6],
  732. moc2.ManufacturerGuid.Data4[7]);
  733. MMCapsMidAndPid(moc2.wMid, NULL, moc2.wPid, ach);
  734. AppMEditPrintF(hedit, " Product Id: %s\r\n", (LPSTR)ach);
  735. AppMEditPrintF(hedit, " Product GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  736. moc2.ProductGuid.Data1,
  737. moc2.ProductGuid.Data2,
  738. moc2.ProductGuid.Data3,
  739. moc2.ProductGuid.Data4[0],
  740. moc2.ProductGuid.Data4[1],
  741. moc2.ProductGuid.Data4[2],
  742. moc2.ProductGuid.Data4[3],
  743. moc2.ProductGuid.Data4[4],
  744. moc2.ProductGuid.Data4[5],
  745. moc2.ProductGuid.Data4[6],
  746. moc2.ProductGuid.Data4[7]);
  747. AppMEditPrintF(hedit, " Driver Version: %u.%.02u\r\n",
  748. (moc2.vDriverVersion >> 8), (BYTE)moc2.vDriverVersion);
  749. if (moc2.wTechnology > MIDIOUTCAPS_TECHNOLOGY_LAST)
  750. {
  751. wsprintf(ach, "[%u], Unknown", moc2.wTechnology);
  752. psz = ach;
  753. }
  754. else
  755. {
  756. psz = gaszMidiOutCapsTechnology[moc2.wTechnology];
  757. }
  758. AppMEditPrintF(hedit, " Technology: %s\r\n", (LPSTR)psz);
  759. AppMEditPrintF(hedit, " Voices (Patches): %u (if internal synth)\r\n", moc2.wVoices);
  760. AppMEditPrintF(hedit, " Polyphony: %u (if internal synth)\r\n", moc2.wNotes);
  761. AppMEditPrintF(hedit, " Channel Mask: %.04Xh (if internal synth)\r\n", moc2.wChannelMask);
  762. //
  763. //
  764. //
  765. //
  766. AppMEditPrintF(hedit, " Standard Support: [%.08lXh]", moc2.dwSupport);
  767. for (u = 0, dw = moc2.dwSupport; dw; u++)
  768. {
  769. if ((BYTE)dw & (BYTE)1)
  770. {
  771. psz = gaszMidiOutCapsSupport[u];
  772. if (NULL == psz)
  773. {
  774. wsprintf(ach, "Unknown%u", u);
  775. psz = ach;
  776. }
  777. AppMEditPrintF(hedit, ", %s", (LPSTR)psz);
  778. }
  779. dw >>= 1;
  780. }
  781. AppMEditPrintF(hedit, "\r\n");
  782. return (TRUE);
  783. } // MMCapsDetailMidiOut()
  784. //--------------------------------------------------------------------------;
  785. //
  786. // BOOL MMCapsDetailMixer
  787. //
  788. // Description:
  789. //
  790. //
  791. // Arguments:
  792. // HWND hedit:
  793. //
  794. // int nDevId:
  795. //
  796. // Return (BOOL):
  797. //
  798. // History:
  799. // 05/11/93
  800. //
  801. //--------------------------------------------------------------------------;
  802. BOOL FNLOCAL MMCapsDetailMixer
  803. (
  804. HWND hedit,
  805. int nDevId
  806. )
  807. {
  808. TCHAR ach[MMCAPS_MAX_STRING_MIDPID_CHARS];
  809. PSTR psz;
  810. MMRESULT mmr;
  811. MIXERCAPS2 mxc2;
  812. UINT u;
  813. DWORD dw;
  814. AppMEditPrintF(hedit, " Device Type: %s\r\n",
  815. (LPSTR)gaszDeviceType[MMCAPS_DEVTYPE_MIXER]);
  816. #ifdef MIXER_MAPPER
  817. if (-1 == nDevId)
  818. AppMEditPrintF(hedit, " Index (Id): %d (Mapper)\r\n", nDevId);
  819. else
  820. AppMEditPrintF(hedit, " Index (Id): %d\r\n", nDevId);
  821. #else
  822. AppMEditPrintF(hedit, " Index (Id): %d\r\n", nDevId);
  823. #endif
  824. //
  825. //
  826. //
  827. _fmemset(&mxc2, 0, sizeof(mxc2));
  828. mmr = mixerGetDevCaps(nDevId, (PMIXERCAPS)&mxc2, sizeof(mxc2));
  829. if (MMSYSERR_NOERROR != mmr)
  830. {
  831. _fmemset(&mxc2, 0, sizeof(mxc2));
  832. if (-1 != nDevId)
  833. {
  834. lstrcpy(mxc2.szPname, gszBogusCaps);
  835. }
  836. else
  837. {
  838. if (0 != mixerGetNumDevs())
  839. {
  840. mxc2.wMid = MM_MICROSOFT;
  841. mxc2.vDriverVersion = (MMVERSION)GetVersion();
  842. lstrcpy(mxc2.szPname, gszDefaultMapper);
  843. mmr = MMSYSERR_NOERROR;
  844. }
  845. }
  846. }
  847. AppMEditPrintF(hedit, " Product Name: %s\r\n", (LPSTR)mxc2.szPname);
  848. if (MMSYSERR_NOERROR != mmr)
  849. {
  850. return (TRUE);
  851. }
  852. //
  853. //
  854. //
  855. //
  856. AppMEditPrintF(hedit, " Name GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  857. mxc2.NameGuid.Data1,
  858. mxc2.NameGuid.Data2,
  859. mxc2.NameGuid.Data3,
  860. mxc2.NameGuid.Data4[0],
  861. mxc2.NameGuid.Data4[1],
  862. mxc2.NameGuid.Data4[2],
  863. mxc2.NameGuid.Data4[3],
  864. mxc2.NameGuid.Data4[4],
  865. mxc2.NameGuid.Data4[5],
  866. mxc2.NameGuid.Data4[6],
  867. mxc2.NameGuid.Data4[7]);
  868. //
  869. //
  870. //
  871. //
  872. MMCapsMidAndPid(mxc2.wMid, ach, 0, NULL);
  873. AppMEditPrintF(hedit, " Manufacturer Id: %s\r\n", (LPSTR)ach);
  874. AppMEditPrintF(hedit, " Manufacturer GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  875. mxc2.ManufacturerGuid.Data1,
  876. mxc2.ManufacturerGuid.Data2,
  877. mxc2.ManufacturerGuid.Data3,
  878. mxc2.ManufacturerGuid.Data4[0],
  879. mxc2.ManufacturerGuid.Data4[1],
  880. mxc2.ManufacturerGuid.Data4[2],
  881. mxc2.ManufacturerGuid.Data4[3],
  882. mxc2.ManufacturerGuid.Data4[4],
  883. mxc2.ManufacturerGuid.Data4[5],
  884. mxc2.ManufacturerGuid.Data4[6],
  885. mxc2.ManufacturerGuid.Data4[7]);
  886. MMCapsMidAndPid(mxc2.wMid, NULL, mxc2.wPid, ach);
  887. AppMEditPrintF(hedit, " Product Id: %s\r\n", (LPSTR)ach);
  888. AppMEditPrintF(hedit, " Product GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  889. mxc2.ProductGuid.Data1,
  890. mxc2.ProductGuid.Data2,
  891. mxc2.ProductGuid.Data3,
  892. mxc2.ProductGuid.Data4[0],
  893. mxc2.ProductGuid.Data4[1],
  894. mxc2.ProductGuid.Data4[2],
  895. mxc2.ProductGuid.Data4[3],
  896. mxc2.ProductGuid.Data4[4],
  897. mxc2.ProductGuid.Data4[5],
  898. mxc2.ProductGuid.Data4[6],
  899. mxc2.ProductGuid.Data4[7]);
  900. AppMEditPrintF(hedit, " Driver Version: %u.%.02u\r\n",
  901. (mxc2.vDriverVersion >> 8), (BYTE)mxc2.vDriverVersion);
  902. AppMEditPrintF(hedit, " Destinations: %u\r\n", mxc2.cDestinations);
  903. //
  904. //
  905. //
  906. //
  907. AppMEditPrintF(hedit, " Standard Support: [%.08lXh]", mxc2.fdwSupport);
  908. for (u = 0, dw = mxc2.fdwSupport; dw; u++)
  909. {
  910. if ((BYTE)dw & (BYTE)1)
  911. {
  912. psz = gaszMixerCapsSupport[u];
  913. if (NULL == psz)
  914. {
  915. wsprintf(ach, "Unknown%u", u);
  916. psz = ach;
  917. }
  918. AppMEditPrintF(hedit, ", %s", (LPSTR)psz);
  919. }
  920. dw >>= 1;
  921. }
  922. AppMEditPrintF(hedit, "\r\n");
  923. return (TRUE);
  924. } // MMCapsDetailMixer()
  925. //--------------------------------------------------------------------------;
  926. //
  927. // BOOL MMCapsDetailTimer
  928. //
  929. // Description:
  930. //
  931. //
  932. // Arguments:
  933. // HWND hedit:
  934. //
  935. // int nDevId:
  936. //
  937. // Return (BOOL):
  938. //
  939. // History:
  940. // 05/11/93
  941. //
  942. //--------------------------------------------------------------------------;
  943. BOOL FNLOCAL MMCapsDetailTimer
  944. (
  945. HWND hedit,
  946. int nDevId
  947. )
  948. {
  949. MMRESULT mmr;
  950. TIMECAPS tc;
  951. MMVERSION uMMSysVer;
  952. AppMEditPrintF(hedit, " Device Type: %s\r\n",
  953. (LPSTR)gaszDeviceType[MMCAPS_DEVTYPE_TIMER]);
  954. AppMEditPrintF(hedit, " Index (Id): %d\r\n", nDevId);
  955. AppMEditPrintF(hedit, " Product Name: %s\r\n", (LPSTR)gszTimerDevice);
  956. mmr = timeGetDevCaps(&tc, sizeof(tc));
  957. if (MMSYSERR_NOERROR != mmr)
  958. return (TRUE);
  959. //
  960. //
  961. //
  962. //
  963. uMMSysVer = (MMVERSION)GetVersion();
  964. AppMEditPrintF(hedit, " Driver Version: %u.%.02u\r\n",
  965. (uMMSysVer >> 8), (BYTE)uMMSysVer);
  966. AppMEditPrintF(hedit, " Minimum Period: %u\r\n", tc.wPeriodMin);
  967. AppMEditPrintF(hedit, " Maximum Period: %u\r\n", tc.wPeriodMax);
  968. return (TRUE);
  969. } // MMCapsDetailTimer()
  970. //--------------------------------------------------------------------------;
  971. //
  972. // BOOL MMCapsDetailWaveIn
  973. //
  974. // Description:
  975. //
  976. //
  977. // Arguments:
  978. // HWND hedit:
  979. //
  980. // int nDevId:
  981. //
  982. // Return (BOOL):
  983. //
  984. // History:
  985. // 05/11/93
  986. //
  987. //--------------------------------------------------------------------------;
  988. BOOL FNLOCAL MMCapsDetailWaveIn
  989. (
  990. HWND hedit,
  991. int nDevId
  992. )
  993. {
  994. TCHAR ach[MMCAPS_MAX_STRING_MIDPID_CHARS];
  995. PSTR psz;
  996. MMRESULT mmr;
  997. WAVEINCAPS2 wic2;
  998. UINT u;
  999. DWORD dw;
  1000. AppMEditPrintF(hedit, " Device Type: %s\r\n",
  1001. (LPSTR)gaszDeviceType[MMCAPS_DEVTYPE_WAVEIN]);
  1002. if (-1 == nDevId)
  1003. AppMEditPrintF(hedit, " Index (Id): %d (Mapper)\r\n", nDevId);
  1004. else
  1005. AppMEditPrintF(hedit, " Index (Id): %d\r\n", nDevId);
  1006. //
  1007. //
  1008. //
  1009. _fmemset(&wic2, 0, sizeof(wic2));
  1010. mmr = waveInGetDevCaps(nDevId, (PWAVEINCAPS)&wic2, sizeof(wic2));
  1011. if (MMSYSERR_NOERROR != mmr)
  1012. {
  1013. _fmemset(&wic2, 0, sizeof(wic2));
  1014. if (-1 != nDevId)
  1015. {
  1016. lstrcpy(wic2.szPname, gszBogusCaps);
  1017. }
  1018. else
  1019. {
  1020. if (0 != waveInGetNumDevs())
  1021. {
  1022. wic2.wMid = MM_MICROSOFT;
  1023. wic2.vDriverVersion = (MMVERSION)GetVersion();
  1024. lstrcpy(wic2.szPname, gszDefaultMapper);
  1025. mmr = MMSYSERR_NOERROR;
  1026. }
  1027. }
  1028. }
  1029. AppMEditPrintF(hedit, " Product Name: %s\r\n", (LPSTR)wic2.szPname);
  1030. if (MMSYSERR_NOERROR != mmr)
  1031. {
  1032. return (TRUE);
  1033. }
  1034. //
  1035. //
  1036. //
  1037. //
  1038. AppMEditPrintF(hedit, " Name GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  1039. wic2.NameGuid.Data1,
  1040. wic2.NameGuid.Data2,
  1041. wic2.NameGuid.Data3,
  1042. wic2.NameGuid.Data4[0],
  1043. wic2.NameGuid.Data4[1],
  1044. wic2.NameGuid.Data4[2],
  1045. wic2.NameGuid.Data4[3],
  1046. wic2.NameGuid.Data4[4],
  1047. wic2.NameGuid.Data4[5],
  1048. wic2.NameGuid.Data4[6],
  1049. wic2.NameGuid.Data4[7]);
  1050. //
  1051. //
  1052. //
  1053. //
  1054. MMCapsMidAndPid(wic2.wMid, ach, 0, NULL);
  1055. AppMEditPrintF(hedit, " Manufacturer Id: %s\r\n", (LPSTR)ach);
  1056. AppMEditPrintF(hedit, " Manufacturer GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  1057. wic2.ManufacturerGuid.Data1,
  1058. wic2.ManufacturerGuid.Data2,
  1059. wic2.ManufacturerGuid.Data3,
  1060. wic2.ManufacturerGuid.Data4[0],
  1061. wic2.ManufacturerGuid.Data4[1],
  1062. wic2.ManufacturerGuid.Data4[2],
  1063. wic2.ManufacturerGuid.Data4[3],
  1064. wic2.ManufacturerGuid.Data4[4],
  1065. wic2.ManufacturerGuid.Data4[5],
  1066. wic2.ManufacturerGuid.Data4[6],
  1067. wic2.ManufacturerGuid.Data4[7]);
  1068. MMCapsMidAndPid(wic2.wMid, NULL, wic2.wPid, ach);
  1069. AppMEditPrintF(hedit, " Product Id: %s\r\n", (LPSTR)ach);
  1070. AppMEditPrintF(hedit, " Product GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  1071. wic2.ProductGuid.Data1,
  1072. wic2.ProductGuid.Data2,
  1073. wic2.ProductGuid.Data3,
  1074. wic2.ProductGuid.Data4[0],
  1075. wic2.ProductGuid.Data4[1],
  1076. wic2.ProductGuid.Data4[2],
  1077. wic2.ProductGuid.Data4[3],
  1078. wic2.ProductGuid.Data4[4],
  1079. wic2.ProductGuid.Data4[5],
  1080. wic2.ProductGuid.Data4[6],
  1081. wic2.ProductGuid.Data4[7]);
  1082. AppMEditPrintF(hedit, " Driver Version: %u.%.02u\r\n",
  1083. (wic2.vDriverVersion >> 8), (BYTE)wic2.vDriverVersion);
  1084. AppMEditPrintF(hedit, " Channels: %u\r\n", wic2.wChannels);
  1085. //
  1086. //
  1087. //
  1088. //
  1089. AppMEditPrintF(hedit, " Standard Formats: [%.08lXh]", wic2.dwFormats);
  1090. for (u = 0, dw = wic2.dwFormats; dw; u++)
  1091. {
  1092. if ((BYTE)dw & (BYTE)1)
  1093. {
  1094. psz = gaszWaveInOutCapsFormats[u];
  1095. if (NULL == psz)
  1096. {
  1097. wsprintf(ach, "Unknown%u", u);
  1098. psz = ach;
  1099. }
  1100. AppMEditPrintF(hedit, ", %s", (LPSTR)psz);
  1101. }
  1102. dw >>= 1;
  1103. }
  1104. AppMEditPrintF(hedit, "\r\n");
  1105. return (TRUE);
  1106. } // MMCapsDetailWaveIn()
  1107. //--------------------------------------------------------------------------;
  1108. //
  1109. // BOOL MMCapsDetailWaveOut
  1110. //
  1111. // Description:
  1112. //
  1113. //
  1114. // Arguments:
  1115. // HWND hedit:
  1116. //
  1117. // int nDevId:
  1118. //
  1119. // Return (BOOL):
  1120. //
  1121. // History:
  1122. // 05/11/93
  1123. //
  1124. //--------------------------------------------------------------------------;
  1125. BOOL FNLOCAL MMCapsDetailWaveOut
  1126. (
  1127. HWND hedit,
  1128. int nDevId
  1129. )
  1130. {
  1131. TCHAR ach[MMCAPS_MAX_STRING_MIDPID_CHARS];
  1132. PSTR psz;
  1133. MMRESULT mmr;
  1134. WAVEOUTCAPS2 woc2;
  1135. UINT u;
  1136. DWORD dw;
  1137. AppMEditPrintF(hedit, " Device Type: %s\r\n",
  1138. (LPSTR)gaszDeviceType[MMCAPS_DEVTYPE_WAVEOUT]);
  1139. if (-1 == nDevId)
  1140. AppMEditPrintF(hedit, " Index (Id): %d (Mapper)\r\n", nDevId);
  1141. else
  1142. AppMEditPrintF(hedit, " Index (Id): %d\r\n", nDevId);
  1143. //
  1144. //
  1145. //
  1146. _fmemset(&woc2, 0, sizeof(woc2));
  1147. mmr = waveOutGetDevCaps(nDevId, (PWAVEOUTCAPS)&woc2, sizeof(woc2));
  1148. if (MMSYSERR_NOERROR != mmr)
  1149. {
  1150. _fmemset(&woc2, 0, sizeof(woc2));
  1151. if (-1 != nDevId)
  1152. {
  1153. lstrcpy(woc2.szPname, gszBogusCaps);
  1154. }
  1155. else
  1156. {
  1157. if (0 != waveOutGetNumDevs())
  1158. {
  1159. woc2.wMid = MM_MICROSOFT;
  1160. woc2.vDriverVersion = (MMVERSION)GetVersion();
  1161. lstrcpy(woc2.szPname, gszDefaultMapper);
  1162. mmr = MMSYSERR_NOERROR;
  1163. }
  1164. }
  1165. }
  1166. AppMEditPrintF(hedit, " Product Name: %s\r\n", (LPSTR)woc2.szPname);
  1167. if (MMSYSERR_NOERROR != mmr)
  1168. {
  1169. return (TRUE);
  1170. }
  1171. //
  1172. //
  1173. //
  1174. //
  1175. AppMEditPrintF(hedit, " Name GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  1176. woc2.NameGuid.Data1,
  1177. woc2.NameGuid.Data2,
  1178. woc2.NameGuid.Data3,
  1179. woc2.NameGuid.Data4[0],
  1180. woc2.NameGuid.Data4[1],
  1181. woc2.NameGuid.Data4[2],
  1182. woc2.NameGuid.Data4[3],
  1183. woc2.NameGuid.Data4[4],
  1184. woc2.NameGuid.Data4[5],
  1185. woc2.NameGuid.Data4[6],
  1186. woc2.NameGuid.Data4[7]);
  1187. //
  1188. //
  1189. //
  1190. //
  1191. MMCapsMidAndPid(woc2.wMid, ach, 0, NULL);
  1192. AppMEditPrintF(hedit, " Manufacturer Id: %s\r\n", (LPSTR)ach);
  1193. AppMEditPrintF(hedit, " Manufacturer GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  1194. woc2.ManufacturerGuid.Data1,
  1195. woc2.ManufacturerGuid.Data2,
  1196. woc2.ManufacturerGuid.Data3,
  1197. woc2.ManufacturerGuid.Data4[0],
  1198. woc2.ManufacturerGuid.Data4[1],
  1199. woc2.ManufacturerGuid.Data4[2],
  1200. woc2.ManufacturerGuid.Data4[3],
  1201. woc2.ManufacturerGuid.Data4[4],
  1202. woc2.ManufacturerGuid.Data4[5],
  1203. woc2.ManufacturerGuid.Data4[6],
  1204. woc2.ManufacturerGuid.Data4[7]);
  1205. MMCapsMidAndPid(woc2.wMid, NULL, woc2.wPid, ach);
  1206. AppMEditPrintF(hedit, " Product Id: %s\r\n", (LPSTR)ach);
  1207. AppMEditPrintF(hedit, " Product GUID: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\r\n",
  1208. woc2.ProductGuid.Data1,
  1209. woc2.ProductGuid.Data2,
  1210. woc2.ProductGuid.Data3,
  1211. woc2.ProductGuid.Data4[0],
  1212. woc2.ProductGuid.Data4[1],
  1213. woc2.ProductGuid.Data4[2],
  1214. woc2.ProductGuid.Data4[3],
  1215. woc2.ProductGuid.Data4[4],
  1216. woc2.ProductGuid.Data4[5],
  1217. woc2.ProductGuid.Data4[6],
  1218. woc2.ProductGuid.Data4[7]);
  1219. AppMEditPrintF(hedit, " Driver Version: %u.%.02u\r\n",
  1220. (woc2.vDriverVersion >> 8), (BYTE)woc2.vDriverVersion);
  1221. AppMEditPrintF(hedit, " Channels: %u\r\n", woc2.wChannels);
  1222. //
  1223. //
  1224. //
  1225. //
  1226. AppMEditPrintF(hedit, " Standard Formats: [%.08lXh]", woc2.dwFormats);
  1227. for (u = 0, dw = woc2.dwFormats; dw; u++)
  1228. {
  1229. if ((BYTE)dw & (BYTE)1)
  1230. {
  1231. psz = gaszWaveInOutCapsFormats[u];
  1232. if (NULL == psz)
  1233. {
  1234. wsprintf(ach, "Unknown%u", u);
  1235. psz = ach;
  1236. }
  1237. AppMEditPrintF(hedit, ", %s", (LPSTR)psz);
  1238. }
  1239. dw >>= 1;
  1240. }
  1241. AppMEditPrintF(hedit, "\r\n");
  1242. //
  1243. //
  1244. //
  1245. //
  1246. AppMEditPrintF(hedit, " Standard Support: [%.08lXh]", woc2.dwSupport);
  1247. for (u = 0, dw = woc2.dwSupport; dw; u++)
  1248. {
  1249. if ((BYTE)dw & (BYTE)1)
  1250. {
  1251. psz = gaszWaveOutCapsSupport[u];
  1252. if (NULL == psz)
  1253. {
  1254. wsprintf(ach, "Unknown%u", u);
  1255. psz = ach;
  1256. }
  1257. AppMEditPrintF(hedit, ", %s", (LPSTR)psz);
  1258. }
  1259. dw >>= 1;
  1260. }
  1261. AppMEditPrintF(hedit, "\r\n");
  1262. return (TRUE);
  1263. } // MMCapsDetailWaveOut()
  1264. //==========================================================================;
  1265. //
  1266. //
  1267. //
  1268. //
  1269. //==========================================================================;
  1270. //--------------------------------------------------------------------------;
  1271. //
  1272. // BOOL MMCapsDetailLowLevel
  1273. //
  1274. // Description:
  1275. //
  1276. //
  1277. // Arguments:
  1278. // HWND hedit:
  1279. //
  1280. // LPARAM lParam:
  1281. //
  1282. // Return (BOOL):
  1283. //
  1284. // History:
  1285. // 05/16/93
  1286. //
  1287. //--------------------------------------------------------------------------;
  1288. BOOL FNGLOBAL MMCapsDetailLowLevel
  1289. (
  1290. HWND hedit,
  1291. LPARAM lParam
  1292. )
  1293. {
  1294. int nDevId;
  1295. UINT uDevType;
  1296. //
  1297. // HIWORD(lParam): MMCAPS_DEVTYPE_*
  1298. // LOWORD(lParam): Device index (id)
  1299. //
  1300. nDevId = (int)(short)LOWORD(lParam);
  1301. uDevType = HIWORD(lParam);
  1302. //
  1303. //
  1304. //
  1305. //
  1306. switch (uDevType)
  1307. {
  1308. case MMCAPS_DEVTYPE_AUXILIARY:
  1309. MMCapsDetailAuxiliary(hedit, nDevId);
  1310. break;
  1311. case MMCAPS_DEVTYPE_JOYSTICK:
  1312. MMCapsDetailJoystick(hedit, nDevId);
  1313. break;
  1314. case MMCAPS_DEVTYPE_MIDIIN:
  1315. MMCapsDetailMidiIn(hedit, nDevId);
  1316. break;
  1317. case MMCAPS_DEVTYPE_MIDIOUT:
  1318. MMCapsDetailMidiOut(hedit, nDevId);
  1319. break;
  1320. case MMCAPS_DEVTYPE_MIXER:
  1321. MMCapsDetailMixer(hedit, nDevId);
  1322. break;
  1323. case MMCAPS_DEVTYPE_TIMER:
  1324. MMCapsDetailTimer(hedit, nDevId);
  1325. break;
  1326. case MMCAPS_DEVTYPE_WAVEIN:
  1327. MMCapsDetailWaveIn(hedit, nDevId);
  1328. break;
  1329. case MMCAPS_DEVTYPE_WAVEOUT:
  1330. MMCapsDetailWaveOut(hedit, nDevId);
  1331. break;
  1332. }
  1333. //
  1334. //
  1335. //
  1336. return (TRUE);
  1337. } // MMCapsDetailLowLevel()
  1338. //--------------------------------------------------------------------------;
  1339. //
  1340. // BOOL MMCapsEnumerateLowLevel
  1341. //
  1342. // Description:
  1343. //
  1344. //
  1345. // Arguments:
  1346. // PZYZTABBEDLISTBOX ptlb:
  1347. //
  1348. // BOOL fComplete:
  1349. //
  1350. // Return (BOOL):
  1351. //
  1352. // History:
  1353. // 05/18/93
  1354. //
  1355. //--------------------------------------------------------------------------;
  1356. BOOL FNGLOBAL MMCapsEnumerateLowLevel
  1357. (
  1358. PZYZTABBEDLISTBOX ptlb,
  1359. BOOL fComplete
  1360. )
  1361. {
  1362. TCHAR ach[128];
  1363. MMRESULT mmr;
  1364. int n;
  1365. int nDevs;
  1366. int nIndex;
  1367. LPARAM lParam;
  1368. UINT uDevType;
  1369. MMVERSION uMMSysVer;
  1370. HWND hlb;
  1371. //
  1372. //
  1373. //
  1374. //
  1375. //
  1376. if (fComplete)
  1377. {
  1378. TlbSetTitleAndTabs(ptlb, gszDeviceFormatTitle, FALSE);
  1379. }
  1380. hlb = ptlb->hlb;
  1381. uMMSysVer = (MMVERSION)GetVersion();
  1382. //
  1383. //
  1384. //
  1385. nDevs = auxGetNumDevs();
  1386. for (n = -1; n < nDevs; n++)
  1387. {
  1388. AUXCAPS ac;
  1389. mmr = auxGetDevCaps(n, &ac, sizeof(ac));
  1390. if (MMSYSERR_NOERROR != mmr)
  1391. {
  1392. if (-1 != n)
  1393. {
  1394. ac.vDriverVersion = 0;
  1395. lstrcpy(ac.szPname, gszBogusCaps);
  1396. }
  1397. else
  1398. {
  1399. if (0 == nDevs)
  1400. break;
  1401. ac.vDriverVersion = uMMSysVer;
  1402. lstrcpy(ac.szPname, gszDefaultMapper);
  1403. }
  1404. }
  1405. //
  1406. //
  1407. //
  1408. uDevType = MMCAPS_DEVTYPE_AUXILIARY;
  1409. wsprintf(ach, gszDeviceFormatList, (LPSTR)gaszDeviceType[uDevType],
  1410. n, (ac.vDriverVersion >> 8), (BYTE)ac.vDriverVersion,
  1411. (LPSTR)ac.szPname);
  1412. nIndex = ListBox_AddString(hlb, ach);
  1413. lParam = MAKELPARAM((WORD)n, (WORD)uDevType);
  1414. ListBox_SetItemData(hlb, nIndex, lParam);
  1415. }
  1416. //
  1417. //
  1418. //
  1419. nDevs = joyGetNumDevs();
  1420. for (n = 0; n < nDevs; n++)
  1421. {
  1422. JOYCAPS jc;
  1423. mmr = joyGetDevCaps(n, &jc, sizeof(jc));
  1424. if (MMSYSERR_NOERROR != mmr)
  1425. {
  1426. lstrcpy(jc.szPname, gszBogusCaps);
  1427. }
  1428. //
  1429. //
  1430. //
  1431. uDevType = MMCAPS_DEVTYPE_JOYSTICK;
  1432. wsprintf(ach, gszDeviceFormatList, (LPSTR)gaszDeviceType[uDevType],
  1433. n, 0, 0, (LPSTR)jc.szPname);
  1434. nIndex = ListBox_AddString(hlb, ach);
  1435. lParam = MAKELPARAM((WORD)n, (WORD)uDevType);
  1436. ListBox_SetItemData(hlb, nIndex, lParam);
  1437. }
  1438. //
  1439. //
  1440. //
  1441. nDevs = midiInGetNumDevs();
  1442. for (n = -1; n < nDevs; n++)
  1443. {
  1444. MIDIINCAPS mic;
  1445. mmr = midiInGetDevCaps(n, &mic, sizeof(mic));
  1446. if (MMSYSERR_NOERROR != mmr)
  1447. {
  1448. if (-1 != n)
  1449. {
  1450. mic.vDriverVersion = 0;
  1451. lstrcpy(mic.szPname, gszBogusCaps);
  1452. }
  1453. else
  1454. {
  1455. if (0 == nDevs)
  1456. break;
  1457. mic.vDriverVersion = uMMSysVer;
  1458. lstrcpy(mic.szPname, gszDefaultMapper);
  1459. }
  1460. }
  1461. //
  1462. //
  1463. //
  1464. uDevType = MMCAPS_DEVTYPE_MIDIIN;
  1465. wsprintf(ach, gszDeviceFormatList, (LPSTR)gaszDeviceType[uDevType],
  1466. n, (mic.vDriverVersion >> 8), (BYTE)mic.vDriverVersion,
  1467. (LPSTR)mic.szPname);
  1468. nIndex = ListBox_AddString(hlb, ach);
  1469. lParam = MAKELPARAM((WORD)n, (WORD)uDevType);
  1470. ListBox_SetItemData(hlb, nIndex, lParam);
  1471. }
  1472. //
  1473. //
  1474. //
  1475. nDevs = midiOutGetNumDevs();
  1476. for (n = -1; n < nDevs; n++)
  1477. {
  1478. MIDIOUTCAPS moc;
  1479. mmr = midiOutGetDevCaps(n, &moc, sizeof(moc));
  1480. if (MMSYSERR_NOERROR != mmr)
  1481. {
  1482. if (-1 != n)
  1483. {
  1484. moc.vDriverVersion = 0;
  1485. lstrcpy(moc.szPname, gszBogusCaps);
  1486. }
  1487. else
  1488. {
  1489. if (0 == nDevs)
  1490. break;
  1491. moc.vDriverVersion = uMMSysVer;
  1492. lstrcpy(moc.szPname, gszDefaultMapper);
  1493. }
  1494. }
  1495. //
  1496. //
  1497. //
  1498. uDevType = MMCAPS_DEVTYPE_MIDIOUT;
  1499. wsprintf(ach, gszDeviceFormatList, (LPSTR)gaszDeviceType[uDevType],
  1500. n, (moc.vDriverVersion >> 8), (BYTE)moc.vDriverVersion,
  1501. (LPSTR)moc.szPname);
  1502. nIndex = ListBox_AddString(hlb, ach);
  1503. lParam = MAKELPARAM((WORD)n, (WORD)uDevType);
  1504. ListBox_SetItemData(hlb, nIndex, lParam);
  1505. }
  1506. //
  1507. //
  1508. //
  1509. //
  1510. //
  1511. //#ifndef WIN32
  1512. nDevs = mixerGetNumDevs();
  1513. #ifdef MIXER_MAPPER
  1514. for (n = -1; n < nDevs; n++)
  1515. #else
  1516. for (n = 0; n < nDevs; n++)
  1517. #endif
  1518. {
  1519. MIXERCAPS mxc;
  1520. mmr = mixerGetDevCaps(n, &mxc, sizeof(mxc));
  1521. if (MMSYSERR_NOERROR != mmr)
  1522. {
  1523. if (-1 != n)
  1524. {
  1525. mxc.vDriverVersion = 0;
  1526. lstrcpy(mxc.szPname, gszBogusCaps);
  1527. }
  1528. else
  1529. {
  1530. if (0 == nDevs)
  1531. break;
  1532. mxc.vDriverVersion = uMMSysVer;
  1533. lstrcpy(mxc.szPname, gszDefaultMapper);
  1534. }
  1535. }
  1536. //
  1537. //
  1538. //
  1539. uDevType = MMCAPS_DEVTYPE_MIXER;
  1540. wsprintf(ach, gszDeviceFormatList, (LPSTR)gaszDeviceType[uDevType],
  1541. n, (mxc.vDriverVersion >> 8), (BYTE)mxc.vDriverVersion,
  1542. (LPSTR)mxc.szPname);
  1543. nIndex = ListBox_AddString(hlb, ach);
  1544. lParam = MAKELPARAM((WORD)n, (WORD)uDevType);
  1545. ListBox_SetItemData(hlb, nIndex, lParam);
  1546. }
  1547. //#endif
  1548. //
  1549. //
  1550. //
  1551. {
  1552. TIMECAPS tc;
  1553. mmr = timeGetDevCaps(&tc, sizeof(tc));
  1554. if (MMSYSERR_NOERROR == mmr)
  1555. {
  1556. //
  1557. //
  1558. //
  1559. uDevType = MMCAPS_DEVTYPE_TIMER;
  1560. wsprintf(ach, gszDeviceFormatList, (LPSTR)gaszDeviceType[uDevType],
  1561. 0, (uMMSysVer >> 8), (BYTE)uMMSysVer,
  1562. (LPSTR)gszTimerDevice);
  1563. nIndex = ListBox_AddString(hlb, ach);
  1564. lParam = MAKELPARAM(0, (WORD)uDevType);
  1565. ListBox_SetItemData(hlb, nIndex, lParam);
  1566. }
  1567. }
  1568. //
  1569. //
  1570. //
  1571. nDevs = waveInGetNumDevs();
  1572. for (n = -1; n < nDevs; n++)
  1573. {
  1574. WAVEINCAPS wic;
  1575. mmr = waveInGetDevCaps(n, &wic, sizeof(wic));
  1576. if (MMSYSERR_NOERROR != mmr)
  1577. {
  1578. if (-1 != n)
  1579. {
  1580. wic.vDriverVersion = 0;
  1581. lstrcpy(wic.szPname, gszBogusCaps);
  1582. }
  1583. else
  1584. {
  1585. if (0 == nDevs)
  1586. break;
  1587. wic.vDriverVersion = uMMSysVer;
  1588. lstrcpy(wic.szPname, gszDefaultMapper);
  1589. }
  1590. }
  1591. //
  1592. //
  1593. //
  1594. uDevType = MMCAPS_DEVTYPE_WAVEIN;
  1595. wsprintf(ach, gszDeviceFormatList, (LPSTR)gaszDeviceType[uDevType],
  1596. n, (wic.vDriverVersion >> 8), (BYTE)wic.vDriverVersion,
  1597. (LPSTR)wic.szPname);
  1598. nIndex = ListBox_AddString(hlb, ach);
  1599. lParam = MAKELPARAM((WORD)n, (WORD)uDevType);
  1600. ListBox_SetItemData(hlb, nIndex, lParam);
  1601. }
  1602. //
  1603. //
  1604. //
  1605. nDevs = waveOutGetNumDevs();
  1606. for (n = -1; n < nDevs; n++)
  1607. {
  1608. WAVEOUTCAPS woc;
  1609. mmr = waveOutGetDevCaps(n, &woc, sizeof(woc));
  1610. if (MMSYSERR_NOERROR != mmr)
  1611. {
  1612. if (-1 != n)
  1613. {
  1614. woc.vDriverVersion = 0;
  1615. lstrcpy(woc.szPname, gszBogusCaps);
  1616. }
  1617. else
  1618. {
  1619. if (0 == nDevs)
  1620. break;
  1621. woc.vDriverVersion = uMMSysVer;
  1622. lstrcpy(woc.szPname, gszDefaultMapper);
  1623. }
  1624. }
  1625. //
  1626. //
  1627. //
  1628. uDevType = MMCAPS_DEVTYPE_WAVEOUT;
  1629. wsprintf(ach, gszDeviceFormatList, (LPSTR)gaszDeviceType[uDevType],
  1630. n, (woc.vDriverVersion >> 8), (BYTE)woc.vDriverVersion,
  1631. (LPSTR)woc.szPname);
  1632. nIndex = ListBox_AddString(hlb, ach);
  1633. lParam = MAKELPARAM((WORD)n, (WORD)uDevType);
  1634. ListBox_SetItemData(hlb, nIndex, lParam);
  1635. }
  1636. //
  1637. //
  1638. //
  1639. return (TRUE);
  1640. } // MMCapsEnumerateLowLevel()