home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Multimedia Jumpstart 1.1a / CD_ROM.BIN / develpmt / source / waveconv / waveio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-12  |  3.1 KB  |  107 lines

  1. /** waveio.h
  2.  *
  3.      (C) Copyright Microsoft Corp. 1991, 1992.  All rights reserved.
  4.  
  5.      You have a royalty-free right to use, modify, reproduce and 
  6.      distribute the Sample Files (and/or any modified version) in 
  7.      any way you find useful, provided that you agree that 
  8.      Microsoft has no warranty obligations or liability for any 
  9.      Sample Application Files which are modified. 
  10.      
  11.      If you did not get this from Microsoft Sources, then it may not be the
  12.      most current version.  This sample code in particular will be updated
  13.      and include more documentation.  
  14.  
  15.      Sources are:
  16.          The MM Sys File Transfer BBS: The phone number is 206 936-4082.
  17.     CompuServe: WINSDK forum, MDK section.
  18.     Anonymous FTP from ftp.uu.net vendors\microsoft\multimedia
  19.  *
  20.  ** */
  21.  
  22.  
  23. #ifndef _WAVEIO_H_
  24. #define _WAVEIO_H_
  25.  
  26. #define WIOAPI    FAR PASCAL
  27.  
  28. #define MAX_WAVEHDRS    10
  29.  
  30.  
  31. // default to total of 4 seconds (as MCI WAVE does)
  32. #define AVG_BUF_MS    (4000/MAX_WAVEHDRS)
  33. // play 4 seconds of audio for synchronous driver
  34. #define SYNC_BUF_MS    (4000)
  35.  
  36.             
  37. typedef struct tWAVEIOCB
  38. {
  39.     HWAVEOUT        hwo;
  40.     DWORD           dwSize;
  41.     DWORD           dwFlags;
  42.     HMMIO           hmmio;
  43.  
  44.     DWORD        dwDataOffset;
  45.     DWORD           dwDataBytes;
  46.     DWORD           dwDataSamples;
  47.     DWORD        dwBytesLeft;
  48.     DWORD        dwBytesPerBuffer;
  49.     
  50.     DISP FAR *        pDisp;
  51.     INFOCHUNK FAR * pInfo;
  52.     WAVEHDR FAR *   apWaveHdr[MAX_WAVEHDRS];
  53.     WORD        apWHUsed[MAX_WAVEHDRS];
  54.  
  55.     WORD            wBytesPerBuffer;
  56.  
  57.     //
  58.     //  this MUST be the last element in this structure--its length is
  59.     //  not fixed; use ab[] to get at any extra bytes (note! the length
  60.     //  of ab[] is in wfx.cbSize--this CAN be zero!)
  61.     //
  62.     WAVEFORMATEX    wfx;
  63.     BYTE            ab[];
  64.  
  65. } WAVEIOCB, *PWAVEIOCB, FAR *LPWAVEIOCB;
  66.  
  67. DECLARE_HANDLE(HWIO);
  68.  
  69. typedef HWIO       *PHWIO;
  70. typedef HWIO FAR   *LPHWIO;
  71.  
  72.  
  73. //
  74. //  error returns from waveio functions
  75. //
  76. #define WIOERR_BASE         (100)
  77. #define WIOERR_NOERROR      (0)
  78. #define WIOERR_ERROR        (WIOERR_BASE+1)
  79. #define WIOERR_BADHANDLE    (WIOERR_BASE+2)
  80. #define WIOERR_BADFLAGS     (WIOERR_BASE+3)
  81. #define WIOERR_BADPARAM     (WIOERR_BASE+4)
  82. #define WIOERR_BADSIZE      (WIOERR_BASE+5)
  83. #define WIOERR_FILEERROR    (WIOERR_BASE+6)
  84. #define WIOERR_NOMEM        (WIOERR_BASE+7)
  85. #define WIOERR_BADFILE        (WIOERR_BASE+8)
  86. #define WIOERR_NODEVICE        (WIOERR_BASE+9)
  87. #define WIOERR_BADFORMAT    (WIOERR_BASE+10)
  88. #define WIOERR_ALLOCATED    (WIOERR_BASE+11)
  89. #define WIOERR_NOTSUPPORTED (WIOERR_BASE+12)
  90.  
  91. //
  92. //  function prototypes and flag definitions
  93. //
  94. LRESULT WIOAPI     wioFileOpen(LPWAVEIOCB FAR * lplpwio, LPCSTR lpszFilePath, DWORD dwFlags);
  95. LRESULT WIOAPI    wioFileClose(LPWAVEIOCB FAR * lplpwio, DWORD dwFlags);
  96.  
  97.  
  98. LRESULT WIOAPI  wioPlayWave(HWND hwnd, LPWAVEIOCB lpwio, LPCSTR lpszFilePath, DWORD dwFlags);
  99. void WIOAPI  wioWaveOutDone(const LPWAVEIOCB lpwio, const LPWAVEHDR pWaveHdr);
  100. void WIOAPI    wioStopWave(const LPWAVEIOCB lpwio);
  101. BOOL WIOAPI    wioIsPlaying(const LPWAVEIOCB lpwio);
  102.  
  103. #endif
  104.  
  105.  
  106. /** EOF: waveio.h **/
  107.