home *** CD-ROM | disk | FTP | other *** search
/ Learn 3D Graphics Programming on the PC / Learn_3D_Graphics_Programming_on_the_PC_Ferraro.iso / rwwin / wmwatcom.h_ / wmwatcom.bin
Text File  |  1995-11-14  |  8KB  |  233 lines

  1. /**********************************************************************
  2.  *
  3.  * File :     wavemix.h
  4.  *
  5.  * Abstract : wavemix wrappers for Watcom C
  6.  *
  7.  **********************************************************************
  8.  *
  9.  * This file is a product of Criterion Software Ltd.
  10.  *
  11.  * This file is provided as is with no warranties of any kind and is
  12.  * provided without any obligation on Criterion Software Ltd. or
  13.  * Canon Inc. to assist in its use or modification.
  14.  *
  15.  * Criterion Software Ltd. will not, under any
  16.  * circumstances, be liable for any lost revenue or other damages arising
  17.  * from the use of this file.
  18.  *
  19.  * Copyright (c) 1995 Criterion Software Ltd.
  20.  * All Rights Reserved.
  21.  *
  22.  * RenderWare is a trademark of Canon Inc.
  23.  *
  24.  ************************************************************************/
  25.  
  26. #ifndef _WAVEMIX_H
  27. #define _WAVEMIX_H
  28.  
  29. #ifdef    __cplusplus
  30. extern "C" {
  31. #endif /* __cplusplus */
  32.  
  33. /*
  34.  * As the WAVEMIX DLL is a 16-bit Visual C++ library built with 2 byte
  35.  * structure packing we need to force Watcom to obey the same convention.
  36.  */
  37. #pragma pack(2)
  38.  
  39. /***********************************************************************
  40.  *
  41.  * Indirect function handles for the entry points.
  42.  *
  43.  ***********************************************************************/
  44.  
  45. extern HINDIR hWaveMixInit;
  46. extern HINDIR hWaveMixConfigureInit;
  47. extern HINDIR hWaveMixActivate;
  48. extern HINDIR hWaveMixOpenWave;
  49. extern HINDIR hWaveMixOpenChannel;
  50. extern HINDIR hWaveMixPlay;
  51. extern HINDIR hWaveMixFlushChannel;
  52. extern HINDIR hWaveMixCloseChannel;
  53. extern HINDIR hWaveMixFreeWave;
  54. extern HINDIR hWaveMixCloseSession;
  55. extern HINDIR hWaveMixPump;
  56. extern HINDIR hWaveMixGetInfo;
  57.  
  58. /***********************************************************************
  59.  *
  60.  * Constant definitions.
  61.  *
  62.  ***********************************************************************/
  63.  
  64. /*
  65.  * Flag values for play params.
  66.  */
  67. #define WMIX_QUEUEWAVE           0x00
  68. #define WMIX_CLEARQUEUE          0x01
  69. #define WMIX_USELRUCHANNEL       0x02
  70. #define WMIX_HIPRIORITY          0x04
  71. #define WMIX_WAIT                0x08
  72.  
  73. #define WMIX_CONFIG_CHANNELS     0x1
  74. #define WMIX_CONFIG_SAMPLINGRATE 0x2
  75.  
  76. #define WMIX_FILE                0x0001
  77. #define WMIX_RESOURCE            0x0002
  78. #define WMIX_MEMORY              0x0004
  79.  
  80. #define WMIX_OPENSINGLE          0 /* open the single channel specified by iChannel */
  81. #define WMIX_OPENALL             1 /* opens all the channels, iChannel ignored */
  82. #define WMIX_OPENCOUNT           2 /* open iChannel Channels (eg. if iChannel = 4 will create channels 0-3) */
  83.  
  84. #define WMIX_ALL                 0x0001 /* stops sound on all the channels, iChannel ignored */
  85. #define WMIX_NOREMIX             0x0002 /* prevents the currently submited blocks from being remixed to exclude new channel */
  86.  
  87. /***********************************************************************
  88.  *
  89.  * Type definitions.
  90.  *
  91.  ***********************************************************************/
  92.  
  93. /*
  94.  * This is normally an LPVOID but, when using Watcom we don't want a
  95.  * 8.32 far pointer but a 16.16 far pointer. As the LPMIXWAVE is
  96.  * opaque all that is necessary is to represent LPMIXWAVE as a 32
  97.  * bit quantity.
  98.  */
  99. typedef DWORD LPMIXWAVE;
  100.  
  101. typedef struct
  102. {
  103.     WORD      wSize;
  104.     HANDLE    hMixSession;
  105.     /*
  106.      * This is normally an int. Unfortunately that means a 32-bit quantity
  107.      * under Watcom and a 16-bit quantity under Visual C++ so I have changed
  108.      * this to a short int.
  109.      */
  110.     short int iChannel;
  111.     LPMIXWAVE lpMixWave;
  112.     HWND      hWndNotify;
  113.     DWORD     dwFlags;
  114.     WORD      wLoops;  /* 0xFFFF means loop forever */
  115. } MIXPLAYPARAMS, *PMIXPLAYPARAM, FAR *LPMIXPLAYPARAMS;
  116.  
  117. typedef struct
  118. {
  119.     WORD      wSize;
  120.     BYTE      bVersionMajor;
  121.     BYTE      bVersionMinor;
  122.     char      szDate[12]; /* Mmm dd yyyy */
  123.     DWORD     dwFormats;  /* see waveOutGetDevCaps (wavemix requires synchronous device) */
  124. } WAVEMIXINFO, *PWAVEMIXINFO, FAR *LPWAVEMIXINFO;
  125.  
  126. typedef struct
  127. {
  128.     WORD  wSize;
  129.     DWORD dwFlags;
  130.     WORD  wChannels;  /* 1 = MONO, 2 = STEREO */
  131.     WORD  wSamplingRate; /* 11,22,44  (11=11025, 22=22050, 44=44100 Hz) */
  132. } MIXCONFIG, *PMIXCONFIG, FAR *LPMIXCONFIG;
  133.  
  134. /***********************************************************************
  135.  *
  136.  * Functions.
  137.  *
  138.  ***********************************************************************/
  139.  
  140. /***********************************************************************/
  141.  
  142. extern BOOL WaveMixOpen(void);
  143.  
  144. /***********************************************************************/
  145.  
  146. extern void WaveMixClose(void);
  147.  
  148. /***********************************************************************/
  149.  
  150. /***********************************************************************
  151.  *
  152.  * Macro functions for the entry points.
  153.  *
  154.  ***********************************************************************/
  155. /***********************************************************************/
  156.  
  157. #define WaveMixInit() \
  158.     ((HANDLE)InvokeIndirectFunction(hWaveMixInit))
  159.  
  160. /***********************************************************************/
  161.  
  162. #define WaveMixConfigureInit(config) \
  163.     ((HANDLE)InvokeIndirectFunction(hWaveMixConfigureInit, (config)))
  164.  
  165. /***********************************************************************/
  166.  
  167. #define WaveMixActivate(session, activate) \
  168.     ((HANDLE)InvokeIndirectFunction(hWaveMixActivate, (session), (WORD)(activate)))
  169.  
  170. /***********************************************************************/
  171.  
  172. #define WaveMixOpenWave(session, filename, instance, flags) \
  173.     ((LPMIXWAVE)InvokeIndirectFunction(hWaveMixOpenWave, (session), (filename), (instance), (DWORD)(flags)))
  174.  
  175. /***********************************************************************/
  176.  
  177. #define WaveMixOpenChannel(session, channel, flags) \
  178.     ((UINT)InvokeIndirectFunction(hWaveMixOpenChannel, (session), (WORD)(channel), (DWORD)(flags)))
  179.  
  180. /***********************************************************************/
  181.  
  182. #define WaveMixPlay(playParams) \
  183.     ((UINT)InvokeIndirectFunction(hWaveMixPlay, (playParams)))
  184.  
  185. /***********************************************************************/
  186.  
  187. #define WaveMixFlushChannel(session, channel, flags) \
  188.     ((UINT)InvokeIndirectFunction(hWaveMixFlushChannel, (session), (WORD)(channel), (DWORD)(flags)))
  189.  
  190. /***********************************************************************/
  191.  
  192. #define WaveMixCloseChannel(session, channel, flags) \
  193.     ((UINT)InvokeIndirectFunction(hWaveMixCloseChannel, (session), (WORD)(channel), (DWORD)(flags)))
  194.  
  195. /***********************************************************************/
  196.  
  197. #define WaveMixFreeWave(session, wave) \
  198.     ((UINT)InvokeIndirectFunction(hWaveMixFreeWave, (session), (wave)))
  199.  
  200. /***********************************************************************/
  201.  
  202. #define WaveMixCloseSession(session) \
  203.     ((UINT)InvokeIndirectFunction(hWaveMixCloseSession, (session)))
  204.  
  205. /***********************************************************************/
  206.  
  207. #define WaveMixPump() \
  208.     ((void)InvokeIndirectFunction(hWaveMixPump))
  209.  
  210. /***********************************************************************/
  211.  
  212. #define WaveMixGetInfo(info) \
  213.     ((WORD)InvokeIndirectFunction(hWaveMixGetInfo, (info)))
  214.  
  215. /***********************************************************************/
  216.  
  217. /*
  218.  * Revert to default structure packing.
  219.  */
  220. #pragma pack()
  221.  
  222. #ifdef    __cplusplus
  223. }
  224. #endif /* __cplusplus */
  225.  
  226. #endif /* _WAVEMIX_H */
  227.  
  228. /***********************************************************************
  229.  *
  230.  * End of file.
  231.  *
  232.  ***********************************************************************/
  233.