home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Multimedia Jumpstart 1.1a / CD_ROM.BIN / develpmt / source / hotspot / viewer / avi.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-05  |  1.7 KB  |  58 lines

  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) 1993  Microsoft Corporation.  All Rights Reserved.
  9.  * 
  10.  **************************************************************************/
  11. /* 
  12.     avi.c:
  13.         initAVI -- initialize avi libraries
  14.         termAVI -- Closes the opened AVI file and the opened device type
  15.  */
  16. #include <windows.h>
  17. #include <mmsystem.h>
  18. #include <digitalv.h>       
  19. #include <viewer.h>
  20.  
  21. #include "hotspot.h"
  22.  
  23. /* 
  24.     initAVI -- Opens the "avivideo" device with MCI_OPEN command
  25.  */
  26. BOOL initAVI(void)
  27. {
  28.     MCI_DGV_OPEN_PARMS  mciOpen;
  29.          
  30.     /* set up the open parameters */
  31.     mciOpen.dwCallback = NULL;
  32.     mciOpen.wDeviceID = mciOpen.wReserved0 =
  33.              mciOpen.wReserved1 = 0;
  34.     mciOpen.lpstrDeviceType = "avivideo";
  35.     mciOpen.lpstrElementName = NULL;
  36.     mciOpen.lpstrAlias = NULL;
  37.     mciOpen.dwStyle = 0;
  38.     mciOpen.hWndParent = NULL;
  39.          
  40.    /* try to open the driver */
  41.    return (mciSendCommand(0, MCI_OPEN, (DWORD)(MCI_OPEN_TYPE), 
  42.                           (DWORD)(LPMCI_DGV_OPEN_PARMS)&mciOpen) == 0);
  43. }
  44.  
  45. /*
  46.     termAVI -- gets device ID for "avivideo" from mciGetDeviceID,
  47.         then closes the device with MCI_CLOSE.
  48. */
  49. void termAVI(void)
  50. {
  51.     WORD               wID;
  52.     MCI_GENERIC_PARMS  mciClose;
  53.  
  54.     wID = mciGetDeviceID("avivideo");
  55.     mciSendCommand(wID, MCI_CLOSE, 0L, 
  56.                    (DWORD)(LPMCI_GENERIC_PARMS)&mciClose);
  57. }
  58.