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.

763 lines
20 KiB

  1. //==========================================================================;
  2. //
  3. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. // PURPOSE.
  7. //
  8. // Copyright (c) 1992 - 1994 Microsoft Corporation. All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11. //
  12. // aawavdev.c
  13. //
  14. // Description:
  15. //
  16. //
  17. //
  18. //==========================================================================;
  19. #include <windows.h>
  20. #include <windowsx.h>
  21. #include <mmsystem.h>
  22. #include <memory.h>
  23. #include <mmreg.h>
  24. #include <msacm.h>
  25. #include "appport.h"
  26. #include "acmapp.h"
  27. #include "debug.h"
  28. //
  29. // WAVE[IN|OUT]CAPS
  30. //
  31. //
  32. //
  33. PTSTR gaszWaveInOutCapsFormats[32] =
  34. {
  35. TEXT("8M11"), // Bit 0 WAVE_FORMAT_1M08
  36. TEXT("8S11"), // Bit 1 WAVE_FORMAT_1S08
  37. TEXT("16M11"), // Bit 2 WAVE_FORMAT_1M16
  38. TEXT("16S11"), // Bit 3 WAVE_FORMAT_1S16
  39. TEXT("8M22"), // Bit 4 WAVE_FORMAT_2M08
  40. TEXT("8S22"), // Bit 5 WAVE_FORMAT_2S08
  41. TEXT("16M22"), // Bit 6 WAVE_FORMAT_2M16
  42. TEXT("16S22"), // Bit 7 WAVE_FORMAT_2S16
  43. TEXT("8M44"), // Bit 8 WAVE_FORMAT_4M08
  44. TEXT("8S44"), // Bit 9 WAVE_FORMAT_4S08
  45. TEXT("16M44"), // Bit 10 WAVE_FORMAT_4M16
  46. TEXT("16S44"), // Bit 11 WAVE_FORMAT_4S16
  47. NULL, // Bit 12
  48. NULL, // Bit 13
  49. NULL, // Bit 14
  50. NULL, // Bit 15
  51. NULL, // Bit 16
  52. NULL, // Bit 17
  53. NULL, // Bit 18
  54. NULL, // Bit 19
  55. NULL, // Bit 20
  56. NULL, // Bit 21
  57. NULL, // Bit 22
  58. NULL, // Bit 23
  59. NULL, // Bit 24
  60. NULL, // Bit 25
  61. NULL, // Bit 26
  62. NULL, // Bit 27
  63. NULL, // Bit 28
  64. NULL, // Bit 29
  65. NULL, // Bit 30
  66. NULL // Bit 31
  67. };
  68. PTSTR gaszWaveOutCapsSupport[32] =
  69. {
  70. TEXT("Pitch"), // Bit 0 WAVECAPS_PITCH
  71. TEXT("Playback Rate"), // Bit 1 WAVECAPS_PLAYBACKRATE
  72. TEXT("Volume"), // Bit 2 WAVECAPS_VOLUME
  73. TEXT("L/R Volume"), // Bit 3 WAVECAPS_LRVOLUME
  74. TEXT("Sync"), // Bit 4 WAVECAPS_SYNC
  75. NULL, // Bit 5
  76. NULL, // Bit 6
  77. NULL, // Bit 7
  78. NULL, // Bit 8
  79. NULL, // Bit 9
  80. NULL, // Bit 10
  81. NULL, // Bit 11
  82. NULL, // Bit 12
  83. NULL, // Bit 13
  84. NULL, // Bit 14
  85. NULL, // Bit 15
  86. NULL, // Bit 16
  87. NULL, // Bit 17
  88. NULL, // Bit 18
  89. NULL, // Bit 19
  90. NULL, // Bit 20
  91. NULL, // Bit 21
  92. NULL, // Bit 22
  93. NULL, // Bit 23
  94. NULL, // Bit 24
  95. NULL, // Bit 25
  96. NULL, // Bit 26
  97. NULL, // Bit 27
  98. NULL, // Bit 28
  99. NULL, // Bit 29
  100. NULL, // Bit 30
  101. NULL // Bit 31
  102. };
  103. //==========================================================================;
  104. //
  105. //
  106. //
  107. //
  108. //==========================================================================;
  109. //--------------------------------------------------------------------------;
  110. //
  111. // MMRESULT AcmAppWaveInGetDevCaps
  112. //
  113. // Description:
  114. //
  115. //
  116. // Arguments:
  117. // UINT uDevId:
  118. //
  119. // LPWAVEINCAPS pwic:
  120. //
  121. // Return (MMRESULT):
  122. //
  123. //
  124. //--------------------------------------------------------------------------;
  125. MMRESULT FNLOCAL AcmAppWaveInGetDevCaps
  126. (
  127. UINT uDevId,
  128. LPWAVEINCAPS pwic
  129. )
  130. {
  131. MMRESULT mmr;
  132. //
  133. //
  134. //
  135. mmr = waveInGetDevCaps(uDevId, pwic, sizeof(*pwic));
  136. if (MMSYSERR_NOERROR == mmr)
  137. {
  138. //
  139. // because some people shipped drivers without testing.
  140. //
  141. pwic->szPname[SIZEOF(pwic->szPname) - 1] = '\0';
  142. }
  143. else
  144. {
  145. _fmemset(pwic, 0, sizeof(*pwic));
  146. if (MMSYSERR_BADDEVICEID == mmr)
  147. {
  148. return (mmr);
  149. }
  150. if (WAVE_MAPPER == uDevId)
  151. {
  152. lstrcpy(pwic->szPname, TEXT("Default Wave Input Mapper"));
  153. }
  154. else
  155. {
  156. wsprintf(pwic->szPname, TEXT("Bad Wave Input Device %u"), uDevId);
  157. }
  158. }
  159. return (MMSYSERR_NOERROR);
  160. } // AcmAppWaveInGetDevCaps()
  161. //--------------------------------------------------------------------------;
  162. //
  163. // MMRESULT AcmAppWaveOutGetDevCaps
  164. //
  165. // Description:
  166. //
  167. //
  168. // Arguments:
  169. // UINT uDevId:
  170. //
  171. // LPWAVEOUTCAPS pwoc:
  172. //
  173. // Return (MMRESULT):
  174. //
  175. //
  176. //--------------------------------------------------------------------------;
  177. MMRESULT FNLOCAL AcmAppWaveOutGetDevCaps
  178. (
  179. UINT uDevId,
  180. LPWAVEOUTCAPS pwoc
  181. )
  182. {
  183. MMRESULT mmr;
  184. //
  185. //
  186. //
  187. mmr = waveOutGetDevCaps(uDevId, pwoc, sizeof(*pwoc));
  188. if (MMSYSERR_NOERROR == mmr)
  189. {
  190. //
  191. // because some people shipped drivers without testing.
  192. //
  193. pwoc->szPname[SIZEOF(pwoc->szPname) - 1] = '\0';
  194. }
  195. else
  196. {
  197. _fmemset(pwoc, 0, sizeof(*pwoc));
  198. if (MMSYSERR_BADDEVICEID == mmr)
  199. {
  200. return (mmr);
  201. }
  202. if (WAVE_MAPPER == uDevId)
  203. {
  204. lstrcpy(pwoc->szPname, TEXT("Default Wave Output Mapper"));
  205. }
  206. else
  207. {
  208. wsprintf(pwoc->szPname, TEXT("Bad Wave Output Device %u"), uDevId);
  209. }
  210. }
  211. return (MMSYSERR_NOERROR);
  212. } // AcmAppWaveOutGetDevCaps()
  213. //--------------------------------------------------------------------------;
  214. //
  215. // BOOL AcmAppDisplayWaveInDevCaps
  216. //
  217. // Description:
  218. //
  219. //
  220. // Arguments:
  221. // HWND hedit:
  222. //
  223. // UINT uDevId:
  224. //
  225. // LPWAVEINCAPS pwic:
  226. //
  227. // Return (BOOL):
  228. //
  229. //
  230. //--------------------------------------------------------------------------;
  231. BOOL FNLOCAL AcmAppDisplayWaveInDevCaps
  232. (
  233. HWND hedit,
  234. UINT uDevId,
  235. LPWAVEINCAPS pwic,
  236. LPWAVEFORMATEX pwfx
  237. )
  238. {
  239. static TCHAR szDisplayTitle[] = TEXT("[Wave Input Device Capabilities]\r\n");
  240. TCHAR ach[40];
  241. PTSTR psz;
  242. UINT u;
  243. UINT v;
  244. DWORD dw;
  245. SetWindowRedraw(hedit, FALSE);
  246. MEditPrintF(hedit, NULL);
  247. MEditPrintF(hedit, szDisplayTitle);
  248. //
  249. //
  250. //
  251. if (NULL != pwfx)
  252. {
  253. TCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS];
  254. TCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS];
  255. MMRESULT mmr;
  256. HWAVEIN hwi;
  257. //
  258. //
  259. //
  260. AcmAppGetFormatDescription(pwfx, szFormatTag, szFormat);
  261. MEditPrintF(hedit, TEXT("%17s: %s"), (LPTSTR)TEXT("Format"), (LPTSTR)szFormatTag);
  262. MEditPrintF(hedit, TEXT("%17s: %s"), (LPTSTR)TEXT("Attributes"), (LPTSTR)szFormat);
  263. //
  264. //
  265. //
  266. MEditPrintF(hedit, TEXT("~%17s: "), (LPTSTR)TEXT("Recordable"));
  267. mmr = waveInOpen(&hwi, uDevId,
  268. #if (WINVER < 0x0400)
  269. (LPWAVEFORMAT)pwfx,
  270. #else
  271. pwfx,
  272. #endif
  273. 0L, 0L, 0L);
  274. if (MMSYSERR_NOERROR == mmr)
  275. {
  276. MEditPrintF(hedit, gszYes);
  277. waveInClose(hwi);
  278. hwi = NULL;
  279. }
  280. else
  281. {
  282. AcmAppGetErrorString(mmr, ach);
  283. MEditPrintF(hedit, TEXT("%s, %s (%u)"), (LPTSTR)gszNo, (LPSTR)ach, mmr);
  284. }
  285. //
  286. //
  287. //
  288. MEditPrintF(hedit, TEXT("~%17s: "), (LPTSTR)TEXT("(Query)"));
  289. mmr = waveInOpen(NULL, uDevId,
  290. #if (WINVER < 0x0400)
  291. (LPWAVEFORMAT)pwfx,
  292. #else
  293. pwfx,
  294. #endif
  295. 0L, 0L, WAVE_FORMAT_QUERY);
  296. if (MMSYSERR_NOERROR == mmr)
  297. {
  298. MEditPrintF(hedit, gszYes);
  299. }
  300. else
  301. {
  302. AcmAppGetErrorString(mmr, ach);
  303. MEditPrintF(hedit, TEXT("%s, %s (%u)"), (LPTSTR)gszNo, (LPSTR)ach, mmr);
  304. }
  305. MEditPrintF(hedit, gszNull);
  306. }
  307. //
  308. //
  309. //
  310. MEditPrintF(hedit, TEXT("%17s: %d"), (LPTSTR)TEXT("Device Id"), uDevId);
  311. MEditPrintF(hedit, TEXT("%17s: %u"), (LPTSTR)TEXT("Manufacturer Id"), pwic->wMid);
  312. MEditPrintF(hedit, TEXT("%17s: %u"), (LPTSTR)TEXT("Product Id"), pwic->wPid);
  313. MEditPrintF(hedit, TEXT("%17s: %u.%.02u"), (LPTSTR)TEXT("Driver Version"),
  314. (pwic->vDriverVersion >> 8),
  315. (pwic->vDriverVersion & 0x00FF));
  316. MEditPrintF(hedit, TEXT("%17s: '%s'"), (LPTSTR)TEXT("Device Name"), (LPTSTR)pwic->szPname);
  317. MEditPrintF(hedit, TEXT("%17s: %u"), (LPTSTR)TEXT("Channels"), pwic->wChannels);
  318. //
  319. //
  320. //
  321. //
  322. MEditPrintF(hedit, TEXT("%17s: %.08lXh"), (LPTSTR)TEXT("Standard Formats"), pwic->dwFormats);
  323. for (v = u = 0, dw = pwic->dwFormats; (0L != dw); u++)
  324. {
  325. if ((BYTE)dw & (BYTE)1)
  326. {
  327. psz = gaszWaveInOutCapsFormats[u];
  328. if (NULL == psz)
  329. {
  330. wsprintf(ach, TEXT("Unknown%u"), u);
  331. psz = ach;
  332. }
  333. if (0 == (v % 4))
  334. {
  335. if (v != 0)
  336. {
  337. MEditPrintF(hedit, gszNull);
  338. }
  339. MEditPrintF(hedit, TEXT("~%19s%s"), (LPTSTR)gszNull, (LPTSTR)psz);
  340. }
  341. else
  342. {
  343. MEditPrintF(hedit, TEXT("~, %s"), (LPTSTR)psz);
  344. }
  345. v++;
  346. }
  347. dw >>= 1;
  348. }
  349. MEditPrintF(hedit, gszNull);
  350. SetWindowRedraw(hedit, TRUE);
  351. return (TRUE);
  352. } // AcmAppDisplayWaveInDevCaps()
  353. //--------------------------------------------------------------------------;
  354. //
  355. // BOOL AcmAppDisplayWaveOutDevCaps
  356. //
  357. // Description:
  358. //
  359. //
  360. // Arguments:
  361. // HWND hedit:
  362. //
  363. // UINT uDevId:
  364. //
  365. // LPWAVEOUTCAPS pwoc:
  366. //
  367. // Return (BOOL):
  368. //
  369. //
  370. //--------------------------------------------------------------------------;
  371. BOOL FNLOCAL AcmAppDisplayWaveOutDevCaps
  372. (
  373. HWND hedit,
  374. UINT uDevId,
  375. LPWAVEOUTCAPS pwoc,
  376. LPWAVEFORMATEX pwfx
  377. )
  378. {
  379. static TCHAR szDisplayTitle[] = TEXT("[Wave Output Device Capabilities]\r\n");
  380. TCHAR ach[40];
  381. PTSTR psz;
  382. UINT u;
  383. UINT v;
  384. DWORD dw;
  385. SetWindowRedraw(hedit, FALSE);
  386. //
  387. //
  388. //
  389. MEditPrintF(hedit, NULL);
  390. MEditPrintF(hedit, szDisplayTitle);
  391. //
  392. //
  393. //
  394. if (NULL != pwfx)
  395. {
  396. TCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS];
  397. TCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS];
  398. MMRESULT mmr;
  399. HWAVEOUT hwo;
  400. DWORD fdwOpen;
  401. fdwOpen = (0 != (WAVECAPS_SYNC & pwoc->dwSupport)) ? 0L : WAVE_ALLOWSYNC;
  402. //
  403. //
  404. //
  405. AcmAppGetFormatDescription(pwfx, szFormatTag, szFormat);
  406. MEditPrintF(hedit, TEXT("%17s: %s"), (LPTSTR)TEXT("Format"), (LPTSTR)szFormatTag);
  407. MEditPrintF(hedit, TEXT("%17s: %s"), (LPTSTR)TEXT("Attributes"), (LPTSTR)szFormat);
  408. //
  409. //
  410. //
  411. MEditPrintF(hedit, TEXT("~%17s: "), (LPTSTR)TEXT("Playable"));
  412. mmr = waveOutOpen(&hwo, uDevId,
  413. #if (WINVER < 0x0400)
  414. (LPWAVEFORMAT)pwfx,
  415. #else
  416. pwfx,
  417. #endif
  418. 0L, 0L, fdwOpen);
  419. if (MMSYSERR_NOERROR == mmr)
  420. {
  421. MEditPrintF(hedit, gszYes);
  422. waveOutClose(hwo);
  423. hwo = NULL;
  424. }
  425. else
  426. {
  427. AcmAppGetErrorString(mmr, ach);
  428. MEditPrintF(hedit, TEXT("%s, %s (%u)"), (LPTSTR)gszNo, (LPSTR)ach, mmr);
  429. }
  430. //
  431. //
  432. //
  433. MEditPrintF(hedit, TEXT("~%17s: "), (LPTSTR)TEXT("(Query)"));
  434. mmr = waveOutOpen(NULL, uDevId,
  435. #if (WINVER < 0x0400)
  436. (LPWAVEFORMAT)pwfx,
  437. #else
  438. pwfx,
  439. #endif
  440. 0L, 0L, fdwOpen | WAVE_FORMAT_QUERY);
  441. if (MMSYSERR_NOERROR == mmr)
  442. {
  443. MEditPrintF(hedit, gszYes);
  444. }
  445. else
  446. {
  447. AcmAppGetErrorString(mmr, ach);
  448. MEditPrintF(hedit, TEXT("%s, %s (%u)"), (LPTSTR)gszNo, (LPSTR)ach, mmr);
  449. }
  450. MEditPrintF(hedit, gszNull);
  451. }
  452. MEditPrintF(hedit, TEXT("%17s: %d"), (LPTSTR)TEXT("Device Id"), uDevId);
  453. MEditPrintF(hedit, TEXT("%17s: %u"), (LPTSTR)TEXT("Manufacturer Id"), pwoc->wMid);
  454. MEditPrintF(hedit, TEXT("%17s: %u"), (LPTSTR)TEXT("Product Id"), pwoc->wPid);
  455. MEditPrintF(hedit, TEXT("%17s: %u.%.02u"), (LPTSTR)TEXT("Driver Version"),
  456. (pwoc->vDriverVersion >> 8),
  457. (pwoc->vDriverVersion & 0x00FF));
  458. MEditPrintF(hedit, TEXT("%17s: '%s'"), (LPTSTR)TEXT("Device Name"), (LPTSTR)pwoc->szPname);
  459. MEditPrintF(hedit, TEXT("%17s: %u"), (LPTSTR)TEXT("Channels"), pwoc->wChannels);
  460. //
  461. //
  462. //
  463. //
  464. MEditPrintF(hedit, TEXT("%17s: %.08lXh"), (LPTSTR)TEXT("Standard Formats"), pwoc->dwFormats);
  465. for (v = u = 0, dw = pwoc->dwFormats; (0L != dw); u++)
  466. {
  467. if ((BYTE)dw & (BYTE)1)
  468. {
  469. psz = gaszWaveInOutCapsFormats[u];
  470. if (NULL == psz)
  471. {
  472. wsprintf(ach, TEXT("Unknown%u"), u);
  473. psz = ach;
  474. }
  475. if (0 == (v % 4))
  476. {
  477. if (v != 0)
  478. {
  479. MEditPrintF(hedit, gszNull);
  480. }
  481. MEditPrintF(hedit, TEXT("~%19s%s"), (LPTSTR)gszNull, (LPTSTR)psz);
  482. }
  483. else
  484. {
  485. MEditPrintF(hedit, TEXT("~, %s"), (LPTSTR)psz);
  486. }
  487. v++;
  488. }
  489. dw >>= 1;
  490. }
  491. MEditPrintF(hedit, gszNull);
  492. //
  493. //
  494. //
  495. //
  496. MEditPrintF(hedit, TEXT("%17s: %.08lXh"), (LPTSTR)TEXT("Standard Support"), pwoc->dwSupport);
  497. for (v = u = 0, dw = pwoc->dwSupport; dw; u++)
  498. {
  499. if ((BYTE)dw & (BYTE)1)
  500. {
  501. psz = gaszWaveOutCapsSupport[u];
  502. if (NULL == psz)
  503. {
  504. wsprintf(ach, TEXT("Unknown%u"), u);
  505. psz = ach;
  506. }
  507. if (0 == (v % 4))
  508. {
  509. if (v != 0)
  510. {
  511. MEditPrintF(hedit, gszNull);
  512. }
  513. MEditPrintF(hedit, TEXT("~%19s%s"), (LPTSTR)gszNull, (LPTSTR)psz);
  514. }
  515. else
  516. {
  517. MEditPrintF(hedit, TEXT("~, %s"), (LPTSTR)psz);
  518. }
  519. v++;
  520. }
  521. dw >>= 1;
  522. }
  523. MEditPrintF(hedit, gszNull);
  524. SetWindowRedraw(hedit, TRUE);
  525. return (TRUE);
  526. } // AcmAppDisplayWaveOutDevCaps()
  527. //--------------------------------------------------------------------------;
  528. //
  529. // BOOL AcmAppWaveDeviceDlgProc
  530. //
  531. // Description:
  532. //
  533. //
  534. // Arguments:
  535. // HWND hwnd:
  536. //
  537. // UINT uMsg:
  538. //
  539. // WPARAM wParam:
  540. //
  541. // LPARAM lParam:
  542. //
  543. // Return (BOOL):
  544. //
  545. //
  546. //--------------------------------------------------------------------------;
  547. BOOL FNEXPORT AcmAppWaveDeviceDlgProc
  548. (
  549. HWND hwnd,
  550. UINT uMsg,
  551. WPARAM wParam,
  552. LPARAM lParam
  553. )
  554. {
  555. LONG lDevice;
  556. BOOL fInput;
  557. UINT uDevId;
  558. UINT cWaveDevs;
  559. UINT u;
  560. UINT uId;
  561. UINT uCmd;
  562. HWND hcb;
  563. HWND hedit;
  564. HFONT hfont;
  565. WAVEINCAPS wic;
  566. WAVEOUTCAPS woc;
  567. lDevice = GetWindowLong(hwnd, DWL_USER);
  568. uDevId = (UINT)(int)(short)LOWORD(lDevice);
  569. fInput = (BOOL)HIWORD(lDevice);
  570. //
  571. //
  572. //
  573. switch (uMsg)
  574. {
  575. case WM_INITDIALOG:
  576. // hfont = GetStockFont(ANSI_FIXED_FONT);
  577. hfont = ghfontApp;
  578. hedit = GetDlgItem(hwnd, IDD_AAWAVEDEVICE_EDIT_CAPABILITIES);
  579. SetWindowFont(hedit, hfont, FALSE);
  580. uDevId = (UINT)(int)(short)LOWORD(lParam);
  581. fInput = (BOOL)HIWORD(lParam);
  582. SetWindowLong(hwnd, DWL_USER, lParam);
  583. //
  584. //
  585. //
  586. hcb = GetDlgItem(hwnd, IDD_AAWAVEDEVICE_COMBO_DEVICE);
  587. SetWindowFont(hcb, hfont, FALSE);
  588. if (fInput)
  589. cWaveDevs = waveInGetNumDevs() + 1;
  590. else
  591. cWaveDevs = waveOutGetNumDevs() + 1;
  592. for (u = (UINT)WAVE_MAPPER; (0 != cWaveDevs); u++, cWaveDevs--)
  593. {
  594. if (fInput)
  595. {
  596. AcmAppWaveInGetDevCaps(u, &wic);
  597. ComboBox_AddString(hcb, wic.szPname);
  598. }
  599. else
  600. {
  601. AcmAppWaveOutGetDevCaps(u, &woc);
  602. ComboBox_AddString(hcb, woc.szPname);
  603. }
  604. if (uDevId == u)
  605. {
  606. hedit = GetDlgItem(hwnd, IDD_AAWAVEDEVICE_EDIT_CAPABILITIES);
  607. if (fInput)
  608. AcmAppDisplayWaveInDevCaps(hedit, uDevId, &wic, gaafd.pwfx);
  609. else
  610. AcmAppDisplayWaveOutDevCaps(hedit, uDevId, &woc, gaafd.pwfx);
  611. }
  612. }
  613. ComboBox_SetCurSel(hcb, uDevId + 1);
  614. return (TRUE);
  615. case WM_COMMAND:
  616. uId = GET_WM_COMMAND_ID(wParam, lParam);
  617. switch (uId)
  618. {
  619. case IDOK:
  620. hcb = GetDlgItem(hwnd, IDD_AAWAVEDEVICE_COMBO_DEVICE);
  621. uDevId = ComboBox_GetCurSel(hcb);
  622. if (CB_ERR != uDevId)
  623. {
  624. EndDialog(hwnd, uDevId - 1);
  625. break;
  626. }
  627. // -- fall through -- //
  628. case IDCANCEL:
  629. EndDialog(hwnd, uDevId);
  630. break;
  631. case IDD_AAWAVEDEVICE_COMBO_DEVICE:
  632. uCmd = GET_WM_COMMAND_CMD(wParam, lParam);
  633. hcb = GET_WM_COMMAND_HWND(wParam, lParam);
  634. switch (uCmd)
  635. {
  636. case CBN_SELCHANGE:
  637. uDevId = ComboBox_GetCurSel(hcb);
  638. if (CB_ERR == uDevId)
  639. break;
  640. uDevId--;
  641. hedit = GetDlgItem(hwnd, IDD_AAWAVEDEVICE_EDIT_CAPABILITIES);
  642. if (fInput)
  643. {
  644. AcmAppWaveInGetDevCaps(uDevId, &wic);
  645. AcmAppDisplayWaveInDevCaps(hedit, uDevId, &wic, gaafd.pwfx);
  646. }
  647. else
  648. {
  649. AcmAppWaveOutGetDevCaps(uDevId, &woc);
  650. AcmAppDisplayWaveOutDevCaps(hedit, uDevId, &woc, gaafd.pwfx);
  651. }
  652. break;
  653. }
  654. }
  655. return (TRUE);
  656. }
  657. return (FALSE);
  658. } // AcmAppWaveDeviceDlgProc()