aviopts.c
Upload User: caisha3
Upload Date: 2013-09-21
Package Size: 208739k
Code Size: 19k
Category:

Windows Develop

Development Platform:

Visual C++

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