Leaked source code of windows server 2003
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.

562 lines
19 KiB

  1. /****************************************************************************
  2. *
  3. * AVIOPTS.C
  4. *
  5. * routine for bringing up the compression options dialog
  6. *
  7. * AVISaveOptions()
  8. *
  9. * Copyright (c) 1992 - 1995 Microsoft Corporation. All Rights Reserved.
  10. *
  11. * You have a royalty-free right to use, modify, reproduce and
  12. * distribute the Sample Files (and/or any modified version) in
  13. * any way you find useful, provided that you agree that
  14. * Microsoft has no warranty obligations or liability for any
  15. * Sample Application Files which are modified.
  16. *
  17. ***************************************************************************/
  18. #include <win32.h>
  19. #include <mmreg.h>
  20. #include <msacm.h>
  21. #include <vfw.h>
  22. #include "aviopts.h"
  23. #include "avifile.rc"
  24. #if !defined NUMELMS
  25. #define NUMELMS(aa) (sizeof(aa)/sizeof((aa)[0]))
  26. #endif
  27. /****************************************************************************
  28. ***************************************************************************/
  29. extern HINSTANCE ghMod;
  30. INT_PTR FAR PASCAL _export AVICompressOptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  31. /****************************************************************************
  32. ***************************************************************************/
  33. int gnNumStreams = 0; // how many streams in array
  34. int gnCurStream = 0; // which stream's options we're setting
  35. PAVISTREAM FAR *gapAVI; // array of stream pointers
  36. LPAVICOMPRESSOPTIONS FAR *gapOpt; // array of option structures to fill
  37. UINT guiFlags;
  38. COMPVARS gCompVars; // for ICCompressorChoose
  39. /****************************************************************************
  40. ***************************************************************************/
  41. /*************************************************************
  42. * @doc EXTERNAL AVISaveOptions
  43. *
  44. * @api BOOL | AVISaveOptions | This function gets the save options for
  45. * a file and returns them in a buffer.
  46. *
  47. * @parm HWND | hwnd | Specifies the parent window handle for the Compression Options
  48. * dialog box.
  49. *
  50. * @parm UINT | uiFlags | Specifies the flags for displaying the
  51. * Compression Options dialog box. The following flags are defined:
  52. *
  53. * @flag ICMF_CHOOSE_KEYFRAME | Displays a "Key frame every" box for
  54. * the video options. This is the same flag used in <f ICCompressorChoose>.
  55. *
  56. * @flag ICMF_CHOOSE_DATARATE | Displays a "Data rate" box for the video
  57. * options. This is the same flag used in <f ICCompressorChoose>.
  58. *
  59. * @flag ICMF_CHOOSE_PREVIEW | Displays a "Preview" button for
  60. * the video options. This button previews the compression
  61. * using a frame from the stream. This is the same flag
  62. * used in <f ICCompressorChoose>.
  63. *
  64. * @parm int | nStreams | Specifies the number of streams
  65. * that will have their options set by the dialog box.
  66. *
  67. * @parm PAVISTREAM FAR * | ppavi | Specifies a pointer to an
  68. * array of stream interface pointers. The <p nStreams>
  69. * parameter indicates the number of pointers in the array.
  70. *
  71. * @parm LPAVICOMPRESSOPTIONS FAR * | plpOptions | Specifies a pointer
  72. * to an array of <t LPAVICOMPRESSOPTIONS> pointers
  73. * to hold the compression options set by the dialog box. The
  74. * <p nStreams> parameter indicates the number of
  75. * pointers in the array.
  76. *
  77. * @rdesc Returns TRUE if the user pressed OK, FALSE for CANCEL or an error.
  78. *
  79. * @comm This function presents a standard Compression Options dialog
  80. * box using <p hwnd> as the parent window handle. When the
  81. * user is finished selecting the compression options for
  82. * each stream, the options are returned in the <t AVICOMPRESSOPTIONS>
  83. * structures in the array referenced by <p lpOptions>. The caller
  84. * must pass the interface pointers for the streams
  85. * in the array referenced by <p ppavi>.
  86. *
  87. ******************************************************************/
  88. STDAPI_(INT_PTR) AVISaveOptions(HWND hwnd, UINT uiFlags, int nStreams, PAVISTREAM FAR *ppavi, LPAVICOMPRESSOPTIONS FAR *plpOptions)
  89. {
  90. INT_PTR f;
  91. AVICOMPRESSOPTIONS FAR *aOptions;
  92. int i;
  93. /* Save the stream pointer */
  94. gnNumStreams = nStreams;
  95. gnCurStream = -1;
  96. gapAVI = ppavi;
  97. gapOpt = plpOptions;
  98. guiFlags = uiFlags;
  99. //
  100. // Remember the old compression options in case we cancel and need to
  101. // restore them
  102. //
  103. aOptions = (AVICOMPRESSOPTIONS FAR *)GlobalAllocPtr(GMEM_MOVEABLE,
  104. nStreams * sizeof(AVICOMPRESSOPTIONS));
  105. if (!aOptions)
  106. return FALSE;
  107. #if 0 //def _WIN32
  108. CopyMemory((PVOID)aOptions, (PVOID)*plpOptions, nStreams * sizeof(AVICOMPRESSOPTIONS));
  109. #else
  110. // We really ought to use memcpy on this...
  111. for (i = 0; i < nStreams; i++)
  112. aOptions[i] = *plpOptions[i];
  113. #endif
  114. f = DialogBox (ghMod, MAKEINTRESOURCE(IDD_COMPRESSOPTIONS), hwnd,
  115. AVICompressOptionsDlgProc);
  116. //
  117. // The user cancelled... put the old compression options back.
  118. //
  119. if (f == 0) {
  120. #if 0 //def _WIN32
  121. CopyMemory((PVOID)*plpOptions, (PVOID)aOptions, nStreams * sizeof(AVICOMPRESSOPTIONS));
  122. #else
  123. // We really ought to use memcpy on this...
  124. for (i = 0; i < nStreams; i++)
  125. *plpOptions[i] = aOptions[i];
  126. #endif
  127. }
  128. // Couldn't bring up the dialog
  129. if (f == -1)
  130. f = 0;
  131. GlobalFreePtr(aOptions);
  132. // !!! Returning TRUE doesn't guarantee something actually changed...
  133. return f;
  134. }
  135. /*************************************************************
  136. * @doc EXTERNAL AVISaveOptionsFree
  137. *
  138. * @api LONG | AVISaveOptionsFree | This function frees the resources allocated
  139. * by <f AVISaveOptions>.
  140. *
  141. * @parm int | nStreams | Specifies the number of <t AVICOMPRESSOPTIONS>
  142. * structures in the array passed in as the next parameter.
  143. *
  144. * @parm LPAVICOMPRESSOPTIONS FAR * | plpOptions | Specifies a pointer
  145. * to an array of <t LPAVICOMPRESSOPTIONS> pointers
  146. * to hold the compression options set by the dialog box. The
  147. * resources in each of these structures that were allocated by
  148. * <f AVISaveOptions> will be freed.
  149. *
  150. * @rdesc This function always returns AVIERR_OK (zero)
  151. *
  152. * @comm This function frees the resources allocated by <f AVISaveOptions>.
  153. **************************************************************/
  154. STDAPI AVISaveOptionsFree(int nStreams, LPAVICOMPRESSOPTIONS FAR *plpOptions)
  155. {
  156. for (; nStreams > 0; nStreams--) {
  157. if (plpOptions[nStreams-1]->lpParms)
  158. GlobalFreePtr(plpOptions[nStreams-1]->lpParms);
  159. plpOptions[nStreams-1]->lpParms = NULL;
  160. if (plpOptions[nStreams-1]->lpFormat)
  161. GlobalFreePtr(plpOptions[nStreams-1]->lpFormat);
  162. plpOptions[nStreams-1]->lpFormat = NULL;
  163. }
  164. return AVIERR_OK;
  165. }
  166. /****************************************************************************
  167. Bring up the compression options for the current stream
  168. ***************************************************************************/
  169. BOOL StreamOptions(HWND hwnd) {
  170. AVISTREAMINFO avis;
  171. BOOL f = FALSE;
  172. LONG lTemp;
  173. UINT w;
  174. // Get the stream type
  175. if (AVIStreamInfo(gapAVI[gnCurStream], &avis, sizeof(avis)) != 0)
  176. return FALSE;
  177. //
  178. // Video stream -- bring up the video compression dlg
  179. //
  180. if (avis.fccType == streamtypeVIDEO) {
  181. // The structure we have now is not filled in ... init it
  182. if (!(gapOpt[gnCurStream]->dwFlags & AVICOMPRESSF_VALID)) {
  183. _fmemset(gapOpt[gnCurStream], 0,
  184. sizeof(AVICOMPRESSOPTIONS));
  185. gapOpt[gnCurStream]->fccHandler = comptypeDIB;
  186. gapOpt[gnCurStream]->dwQuality = (DWORD)ICQUALITY_DEFAULT;
  187. }
  188. _fmemset(&gCompVars, 0, sizeof(gCompVars));
  189. gCompVars.cbSize = sizeof(gCompVars);
  190. gCompVars.dwFlags = ICMF_COMPVARS_VALID;
  191. gCompVars.fccHandler = gapOpt[gnCurStream]->fccHandler;
  192. gCompVars.lQ = gapOpt[gnCurStream]->dwQuality;
  193. gCompVars.lpState = gapOpt[gnCurStream]->lpParms;
  194. gCompVars.cbState = gapOpt[gnCurStream]->cbParms;
  195. gCompVars.lKey =
  196. (gapOpt[gnCurStream]->dwFlags & AVICOMPRESSF_KEYFRAMES)?
  197. (gapOpt[gnCurStream]->dwKeyFrameEvery) : 0;
  198. gCompVars.lDataRate =
  199. (gapOpt[gnCurStream]->dwFlags & AVICOMPRESSF_DATARATE) ?
  200. (gapOpt[gnCurStream]->dwBytesPerSecond / 1024) : 0;
  201. // !!! Don't pass flags verbatim if others are defined!!!
  202. f = ICCompressorChoose(hwnd, guiFlags, NULL,
  203. gapAVI[gnCurStream], &gCompVars, NULL);
  204. /* Set the options to our new values */
  205. gapOpt[gnCurStream]->lpParms = gCompVars.lpState;
  206. gapOpt[gnCurStream]->cbParms = gCompVars.cbState;
  207. gCompVars.lpState = NULL; // so it won't be freed
  208. gapOpt[gnCurStream]->fccHandler = gCompVars.fccHandler;
  209. gapOpt[gnCurStream]->dwQuality = gCompVars.lQ;
  210. gapOpt[gnCurStream]->dwKeyFrameEvery = gCompVars.lKey;
  211. gapOpt[gnCurStream]->dwBytesPerSecond = gCompVars.lDataRate
  212. * 1024;
  213. if (gCompVars.lKey)
  214. gapOpt[gnCurStream]->dwFlags |= AVICOMPRESSF_KEYFRAMES;
  215. else
  216. gapOpt[gnCurStream]->dwFlags &=~AVICOMPRESSF_KEYFRAMES;
  217. if (gCompVars.lDataRate)
  218. gapOpt[gnCurStream]->dwFlags |= AVICOMPRESSF_DATARATE;
  219. else
  220. gapOpt[gnCurStream]->dwFlags &=~AVICOMPRESSF_DATARATE;
  221. // If they pressed OK, we have valid stuff in here now.
  222. if (f)
  223. gapOpt[gnCurStream]->dwFlags |= AVICOMPRESSF_VALID;
  224. // Close the stuff opened by ICCompressorChoose
  225. ICCompressorFree(&gCompVars);
  226. //
  227. // Bring up the ACM format dialog and stuff it in our
  228. // compression options structure
  229. //
  230. } else if (avis.fccType == streamtypeAUDIO) {
  231. ACMFORMATCHOOSE acf;
  232. LONG lsizeF = 0;
  233. if (acmGetVersion() < 0x02000000L) {
  234. TCHAR achACM[160];
  235. TCHAR achACMV[40];
  236. LoadString(ghMod, IDS_BADACM, achACM, sizeof(achACM)/sizeof(TCHAR));
  237. LoadString(ghMod, IDS_BADACMV, achACMV, sizeof(achACMV)/sizeof(TCHAR));
  238. MessageBox(hwnd, achACM, achACMV, MB_OK | MB_ICONHAND);
  239. return FALSE;
  240. }
  241. _fmemset(&acf, 0, sizeof(acf)); // or ACM blows up
  242. acf.cbStruct = sizeof(ACMFORMATCHOOSE);
  243. // If our options struct has valid data, use it to init
  244. // the acm dialog with, otherwise pick a default.
  245. acf.fdwStyle = (gapOpt[gnCurStream]->dwFlags & AVICOMPRESSF_VALID)
  246. ? ACMFORMATCHOOSE_STYLEF_INITTOWFXSTRUCT : 0;
  247. acf.hwndOwner = hwnd;
  248. // Make sure the AVICOMPRESSOPTIONS has a big enough lpFormat
  249. acmMetrics(NULL, ACM_METRIC_MAX_SIZE_FORMAT, (LPVOID)&lTemp);
  250. if ((gapOpt[gnCurStream]->cbFormat == 0 ||
  251. gapOpt[gnCurStream]->lpFormat == NULL) && lTemp) {
  252. gapOpt[gnCurStream]->lpFormat =
  253. GlobalAllocPtr(GMEM_MOVEABLE, lTemp);
  254. gapOpt[gnCurStream]->cbFormat = lTemp;
  255. } else if (gapOpt[gnCurStream]->cbFormat < (DWORD)lTemp && lTemp) {
  256. gapOpt[gnCurStream]->lpFormat =
  257. GlobalReAllocPtr(gapOpt[gnCurStream]->lpFormat, lTemp,
  258. GMEM_MOVEABLE);
  259. gapOpt[gnCurStream]->cbFormat = lTemp;
  260. }
  261. if (!gapOpt[gnCurStream]->lpFormat)
  262. return FALSE;
  263. acf.pwfx = gapOpt[gnCurStream]->lpFormat;
  264. acf.cbwfx = gapOpt[gnCurStream]->cbFormat;
  265. //
  266. // Only ask for choices that we can actually convert to
  267. //
  268. AVIStreamReadFormat(gapAVI[gnCurStream],
  269. AVIStreamStart(gapAVI[gnCurStream]), NULL, &lsizeF);
  270. // !!! Work around ACM bug by making sure our format is big enough
  271. lsizeF = max(lsizeF, sizeof(WAVEFORMATEX));
  272. acf.pwfxEnum = (LPWAVEFORMATEX)
  273. GlobalAllocPtr(GMEM_MOVEABLE | GMEM_ZEROINIT, lsizeF);
  274. if (acf.pwfxEnum) {
  275. AVIStreamReadFormat(gapAVI[gnCurStream],
  276. AVIStreamStart(gapAVI[gnCurStream]), acf.pwfxEnum, &lsizeF);
  277. acf.fdwEnum |= ACM_FORMATENUMF_CONVERT;
  278. }
  279. // If they pressed OK, we now have valid stuff in here!
  280. w = acmFormatChoose(&acf);
  281. if (w == MMSYSERR_NOERROR)
  282. gapOpt[gnCurStream]->dwFlags |= AVICOMPRESSF_VALID;
  283. else if (w != ACMERR_CANCELED) {
  284. MessageBeep(0); // !!! Should really be a message box!
  285. }
  286. if (acf.pwfxEnum)
  287. GlobalFreePtr(acf.pwfxEnum);
  288. f = (w == MMSYSERR_NOERROR);
  289. }
  290. return f;
  291. }
  292. #if defined _WIN32 && !defined UNICODE // Chicago only
  293. /*
  294. * convert a UNICODE string to 'normal'
  295. */
  296. LPTSTR WINAPI aviWideToText (LPTSTR lpszOut, LPWSTR lpwIn, UINT cch)
  297. {
  298. if (sizeof(TCHAR) != sizeof(WCHAR))
  299. WideCharToMultiByte(CP_ACP, 0, lpwIn, cch, lpszOut, cch, NULL, NULL);
  300. else
  301. lstrcpyn (lpszOut, (LPTSTR)lpwIn, cch);
  302. return lpszOut;
  303. }
  304. #else
  305. #define aviWideToText(lpszOut,lpwIn,cch) lstrcpyn(lpszOut,lpwIn,cch)
  306. #endif // _WIN32 on CHICAGO
  307. STATICDT SZCODE aszXbyXbyX[] = TEXT("%ldx%ldx%d\n");
  308. STATICDT SZCODE aszBlahSpaceBlah[] = TEXT("%s %s");
  309. //
  310. // Somebody chose a new stream. Do we need to grey InterleaveOpts?
  311. // Set the current stream.
  312. //
  313. void NEAR PASCAL NewStreamChosen(HWND hwnd)
  314. {
  315. AVISTREAMINFO avis;
  316. HIC hic;
  317. ICINFO icinfo;
  318. ACMFORMATDETAILS acmfmt;
  319. ACMFORMATTAGDETAILS aftd;
  320. LONG lsizeF;
  321. LPBITMAPINFOHEADER lp = NULL;
  322. TCHAR szFFDesc[80];
  323. TCHAR szDesc[120];
  324. gnCurStream = (int)SendDlgItemMessage(hwnd, IDC_intCHOOSESTREAM,
  325. CB_GETCURSEL, 0, 0L);
  326. if (gnCurStream < 0)
  327. return;
  328. if (AVIStreamInfo(gapAVI[gnCurStream], &avis, sizeof(avis)) != 0)
  329. return;
  330. //
  331. // Show a string describing the current format
  332. //
  333. szDesc[0] = TEXT('\0');
  334. lsizeF = 0;
  335. AVIStreamReadFormat(gapAVI[gnCurStream],
  336. AVIStreamStart(gapAVI[gnCurStream]), NULL, &lsizeF);
  337. if (lsizeF) {
  338. lp = (LPBITMAPINFOHEADER)GlobalAllocPtr(GHND, lsizeF);
  339. if (lp) {
  340. if (AVIStreamReadFormat(gapAVI[gnCurStream],
  341. AVIStreamStart(gapAVI[gnCurStream]),
  342. lp, &lsizeF) == AVIERR_OK) {
  343. if (avis.fccType == streamtypeVIDEO) {
  344. wsprintf(szDesc, aszXbyXbyX, lp->biWidth,
  345. lp->biHeight, lp->biBitCount);
  346. if (lp->biCompression == BI_RGB) {
  347. LoadString(ghMod, IDS_FFDESC, szFFDesc,
  348. sizeof(szFFDesc)/sizeof(TCHAR));
  349. lstrcat(szDesc, szFFDesc);
  350. } else {
  351. hic = ICDecompressOpen(ICTYPE_VIDEO,avis.fccHandler,
  352. lp, NULL);
  353. if (hic) {
  354. if (ICGetInfo(hic, &icinfo,sizeof(icinfo)) != 0) {
  355. UINT cb = lstrlen(szDesc);
  356. aviWideToText (szDesc + cb,
  357. icinfo.szDescription,
  358. NUMELMS(szDesc) - cb);
  359. }
  360. ICClose(hic);
  361. }
  362. }
  363. } else if (avis.fccType == streamtypeAUDIO) {
  364. _fmemset(&acmfmt, 0, sizeof(acmfmt));
  365. acmfmt.pwfx = (LPWAVEFORMATEX) lp;
  366. acmfmt.cbStruct = sizeof(ACMFORMATDETAILS);
  367. acmfmt.dwFormatTag = acmfmt.pwfx->wFormatTag;
  368. acmfmt.cbwfx = lsizeF;
  369. aftd.cbStruct = sizeof(aftd);
  370. aftd.dwFormatTag = acmfmt.pwfx->wFormatTag;
  371. aftd.fdwSupport = 0;
  372. if ((acmFormatTagDetails(NULL,
  373. &aftd,
  374. ACM_FORMATTAGDETAILSF_FORMATTAG) == 0) &&
  375. (acmFormatDetails(NULL, &acmfmt,
  376. ACM_FORMATDETAILSF_FORMAT) == 0)) {
  377. wsprintf(szDesc, aszBlahSpaceBlah, (LPTSTR) acmfmt.szFormat,
  378. (LPTSTR) aftd.szFormatTag);
  379. }
  380. }
  381. }
  382. GlobalFreePtr(lp);
  383. }
  384. }
  385. SetDlgItemText(hwnd, IDC_intFORMAT, szDesc);
  386. //
  387. // AUDIO and VIDEO streams have a compression dialog
  388. //
  389. if (avis.fccType == streamtypeAUDIO ||
  390. avis.fccType == streamtypeVIDEO)
  391. EnableWindow(GetDlgItem(hwnd, IDC_intOPTIONS), TRUE);
  392. else
  393. EnableWindow(GetDlgItem(hwnd, IDC_intOPTIONS), FALSE);
  394. }
  395. /*--------------------------------------------------------------+
  396. * Dialog Proc for the main compression options dialog *
  397. +--------------------------------------------------------------*/
  398. INT_PTR FAR PASCAL _export AVICompressOptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
  399. {
  400. int i, nVal;
  401. AVISTREAMINFO avis;
  402. DWORD dw;
  403. BOOL f;
  404. switch(msg){
  405. case WM_INITDIALOG:
  406. //
  407. // If we've only got one stream to set the options for, it seems
  408. // strange to bring up a box to let you choose which stream you want.
  409. // Let's skip straight to the proper options dlg box.
  410. //
  411. if (gnNumStreams == 1) {
  412. gnCurStream = 0;
  413. EndDialog(hwnd, StreamOptions(hwnd));
  414. return TRUE;
  415. }
  416. /* Add the list of streams to the drop-down box */
  417. for (nVal = 0; nVal < gnNumStreams; nVal++) {
  418. // Get the name of this stream
  419. AVIStreamInfo(gapAVI[nVal], &avis, sizeof(avis));
  420. SendDlgItemMessage(hwnd, IDC_intCHOOSESTREAM, CB_ADDSTRING, 0,
  421. (LONG_PTR) (LPTSTR)avis.szName);
  422. }
  423. // Set our initial selection to the first item
  424. SendDlgItemMessage(hwnd, IDC_intCHOOSESTREAM, CB_SETCURSEL, 0, 0L);
  425. // Make sure we see it
  426. SendMessage(hwnd, WM_COMMAND,
  427. GET_WM_COMMAND_MPS(IDC_intCHOOSESTREAM, hwnd, CBN_SELCHANGE));
  428. // Set the interleave boxes for these streams. Every stream should
  429. // be interleaved the same way, so just look at the first guy.
  430. // !!! Admittedly, some app might only set the interleaving for
  431. // the audio stream, and we won't get his intended default here.
  432. // Default to interleave every 1 if we're uninitialized
  433. if (gapOpt[0]->dwFlags & AVICOMPRESSF_VALID) {
  434. f = (gapOpt[0]->dwFlags & AVICOMPRESSF_INTERLEAVE) != 0;
  435. dw = gapOpt[0]->dwInterleaveEvery;
  436. } else {
  437. dw = 1;
  438. f = FALSE;
  439. }
  440. CheckDlgButton(hwnd, IDC_intINTERLEAVE, f);
  441. SetDlgItemInt(hwnd, IDC_intINTERLEAVEEDIT, (int)dw, FALSE);
  442. EnableWindow(GetDlgItem(hwnd, IDC_intINTERLEAVEEDIT), f);
  443. return TRUE;
  444. case WM_COMMAND:
  445. switch(GET_WM_COMMAND_ID(wParam, lParam)){
  446. case IDOK:
  447. // Set the interleaving for every stream to be the same,
  448. // whatever we have chosen. AVIFile doesn't support
  449. // interleaving different streams in different ways.
  450. f = IsDlgButtonChecked(hwnd, IDC_intINTERLEAVE);
  451. dw = (DWORD)GetDlgItemInt(hwnd, IDC_intINTERLEAVEEDIT,
  452. NULL, FALSE);
  453. for (i = 0; i < gnNumStreams; i++) {
  454. gapOpt[i]->dwInterleaveEvery = dw;
  455. if (f)
  456. gapOpt[i]->dwFlags |= AVICOMPRESSF_INTERLEAVE;
  457. else
  458. gapOpt[i]->dwFlags &=~AVICOMPRESSF_INTERLEAVE;
  459. }
  460. // fall through (AAAAaaaahhhhh.....)
  461. case IDCANCEL:
  462. EndDialog(hwnd, wParam == IDOK);
  463. break;
  464. case IDC_intOPTIONS:
  465. StreamOptions(hwnd);
  466. break;
  467. //
  468. // Somebody chose a new stream.
  469. //
  470. case IDC_intCHOOSESTREAM:
  471. if (GET_WM_COMMAND_CMD(wParam, lParam) != CBN_SELCHANGE)
  472. break;
  473. NewStreamChosen(hwnd);
  474. break;
  475. case IDC_intINTERLEAVE:
  476. // Enable the "interleave every" edit box iff we've checked it
  477. f = IsDlgButtonChecked(hwnd, IDC_intINTERLEAVE);
  478. EnableWindow(GetDlgItem(hwnd, IDC_intINTERLEAVEEDIT), f);
  479. break;
  480. default:
  481. break;
  482. }
  483. break;
  484. default:
  485. return FALSE;
  486. }
  487. return FALSE;
  488. }
  489.