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.

244 lines
8.4 KiB

  1. /////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998 Active Voice Corporation. All Rights Reserved.
  4. //
  5. // Active Agent(r) and Unified Communications(tm) are trademarks of Active Voice Corporation.
  6. //
  7. // Other brand and product names used herein are trademarks of their respective owners.
  8. //
  9. // The entire program and user interface including the structure, sequence, selection,
  10. // and arrangement of the dialog, the exclusively "yes" and "no" choices represented
  11. // by "1" and "2," and each dialog message are protected by copyrights registered in
  12. // the United States and by international treaties.
  13. //
  14. // Protected by one or more of the following United States patents: 5,070,526, 5,488,650,
  15. // 5,434,906, 5,581,604, 5,533,102, 5,568,540, 5,625,676, 5,651,054.
  16. //
  17. // Active Voice Corporation
  18. // Seattle, Washington
  19. // USA
  20. //
  21. /////////////////////////////////////////////////////////////////////////////////////////
  22. ////
  23. // wavin.h - interface for wav input device functions in wavin.c
  24. ////
  25. #ifndef __WAVIN_H__
  26. #define __WAVIN_H__
  27. #ifdef _WIN32
  28. #define MULTITHREAD 1
  29. #endif
  30. #include "winlocal.h"
  31. #include "wavfmt.h"
  32. #define WAVIN_VERSION 0x00000108
  33. // handle to wav input device (NOT the same as Windows HWAVEIN)
  34. //
  35. DECLARE_HANDLE32(HWAVIN);
  36. // <dwFlags> values in WavInOpen
  37. //
  38. #define WAVIN_NOSYNC 0x00000001
  39. #define WAVIN_OPENRETRY 0x00000004
  40. #define WAVIN_OPENASYNC 0x00000008
  41. #define WAVIN_CLOSEASYNC 0x00000010
  42. #define WAVIN_NOACM 0x00000020
  43. #define WAVIN_TELRFILE 0x00000040
  44. #ifdef MULTITHREAD
  45. #define WAVIN_MULTITHREAD 0x00000080
  46. #endif
  47. // notification messages sent to <hwndNotify>
  48. //
  49. #define WM_WAVIN_OPEN (WM_USER + 200)
  50. #define WM_WAVIN_CLOSE (WM_USER + 201)
  51. #define WM_WAVIN_RECORDDONE (WM_USER + 202)
  52. #define WM_WAVIN_STOPRECORD (WM_USER + 203)
  53. // structure passed as <lParam> in WM_WAVOUT_RECORDDONE message
  54. //
  55. typedef struct RECORDDONE
  56. {
  57. LPVOID lpBuf;
  58. long sizBuf;
  59. long lBytesRecorded;
  60. } RECORDDONE, FAR *LPRECORDDONE;
  61. // return values from WavInGetState
  62. //
  63. #define WAVIN_STOPPED 0x0001
  64. #define WAVIN_RECORDING 0x0002
  65. #define WAVIN_STOPPING 0x0008
  66. #ifdef __cplusplus
  67. extern "C" {
  68. #endif
  69. // WavInGetDeviceCount - return number of wav input devices found
  70. // <void> this function takes no arguments
  71. // return number of wav input devices found (0 if none)
  72. //
  73. int DLLEXPORT WINAPI WavInGetDeviceCount(void);
  74. // WavInDeviceIsOpen - check if input device is open
  75. // <idDev> (i) device id
  76. // -1 open any suitable input device
  77. // return TRUE if open
  78. //
  79. BOOL DLLEXPORT WINAPI WavInDeviceIsOpen(int idDev);
  80. // WavInOpen - open wav input device
  81. // <dwVersion> (i) must be WAVIN_VERSION
  82. // <hInst> (i) instance handle of calling module
  83. // <idDev> (i) device id
  84. // -1 open any suitable input device
  85. // <lpwfx> (i) wave format
  86. // <hwndNotify> (i) notify this window of device events
  87. // NULL do not notify
  88. // <msTimeoutOpen> (i) device open timeout in milleseconds
  89. // 0 default timeout (30000)
  90. // <msTimeoutRetry> (i) device retry timeout in milleseconds
  91. // 0 default timeout (2000)
  92. // <dwFlags> (i) control flags
  93. // WAVIN_NOSYNC do not open synchronous devices
  94. // WAVIN_OPENRETRY retry if device busy
  95. // WAVIN_OPENASYNC return before notification of device open
  96. // WAVIN_CLOSEASYNC return before notification of device close
  97. // WAVIN_NOACM do not use audio compression manager
  98. // WAVIN_TELRFILE telephone will record audio to file on server
  99. #ifdef MULTITHREAD
  100. // WAVOUT_MULTITHREAD use callback thread rather than window
  101. #endif
  102. // return handle (NULL if error)
  103. //
  104. // NOTE: if <hwndNotify> is specified in WavInOpen,
  105. // WM_WAVIN_OPEN will be sent to <hwndNotify>,
  106. // when input device has been opened.
  107. //
  108. // NOTE: if WAVIN_MULTITHREAD is specified in <dwFlags>,
  109. // it is assumed that <hwndNotify> is not a window handle,
  110. // but rather the id of the thread to receive notifications
  111. //
  112. HWAVIN DLLEXPORT WINAPI WavInOpen(DWORD dwVersion, HINSTANCE hInst,
  113. int idDev, LPWAVEFORMATEX lpwfx, HWND hwndNotify,
  114. DWORD msTimeoutOpen, DWORD msTimeoutRetry, DWORD dwFlags);
  115. // WavInClose - close wav input device
  116. // <hWavIn> (i) handle returned from WavInOpen
  117. // <msTimeoutClose> (i) device close timeout in milleseconds
  118. // 0 default timeout (30000)
  119. // return 0 if success
  120. //
  121. // NOTE: if <hwndNotify> was specified in WavInOpen,
  122. // WM_WAVIN_CLOSE will be sent to <hwndNotify>,
  123. // when input device has been closed.
  124. //
  125. int DLLEXPORT WINAPI WavInClose(HWAVIN hWavIn, DWORD msTimeoutClose);
  126. // WavInRecord - submit buffer of samples to wav input device for recording
  127. // <hWavIn> (i) handle returned from WavInOpen
  128. // <lpBuf> (o) pointer to buffer to be filled with samples
  129. // <sizBuf> (i) size of buffer in bytes
  130. // return 0 if success
  131. //
  132. // NOTE: the buffer pointed to by <lpBuf> must have been allocated
  133. // using MemAlloc().
  134. //
  135. // NOTE: if <hwndNotify> is specified in WavInOpen(), a WM_WAVIN_RECORDDONE
  136. // message will be sent to <hwndNotify>, with <lParam> set to a pointer to
  137. // a RECORDDONE structure, when <lpBuf> has been recorded.
  138. //
  139. int DLLEXPORT WINAPI WavInRecord(HWAVIN hWavIn, LPVOID lpBuf, long sizBuf);
  140. // WavInStop - stop recording into buffer(s) sent to wav input device
  141. // <hWavIn> (i) handle returned from WavInOpen
  142. // <msTimeoutStop> (i) device stop timeout in milleseconds
  143. // 0 default timeout (2000)
  144. // return 0 if success
  145. //
  146. int DLLEXPORT WINAPI WavInStop(HWAVIN hWavIn, DWORD msTimeoutStop);
  147. // WavInGetState - return current wav input device state
  148. // <hWavIn> (i) handle returned from WavInOpen
  149. // return WAVIN_STOPPED, WAVIN_RECORDING, or 0 if error
  150. //
  151. WORD DLLEXPORT WINAPI WavInGetState(HWAVIN hWavIn);
  152. // WavInGetPosition - get milleseconds of elapsed recording
  153. // <hWavIn> (i) handle returned from WavInOpen
  154. // return 0 if success
  155. //
  156. long DLLEXPORT WINAPI WavInGetPosition(HWAVIN hWavIn);
  157. // WavInGetId - return id of wav input device
  158. // <hWavIn> (i) handle returned from WavInOpen
  159. // return device id (-1 if error)
  160. //
  161. int DLLEXPORT WINAPI WavInGetId(HWAVIN hWavIn);
  162. // WavInGetName - get name of wav input device
  163. // <hWavIn> (i) handle returned from WavInOpen
  164. // NULL use unopened device specified in <idDev>
  165. // <idDev> (i) device id (ignored if <hWavIn> is not NULL)
  166. // -1 any suitable input device
  167. // <lpszName> (o) buffer to hold device name
  168. // <sizName> (i) size of buffer
  169. // return 0 if success
  170. //
  171. int DLLEXPORT WINAPI WavInGetName(HWAVIN hWavIn, int idDev, LPTSTR lpszName, int sizName);
  172. // WavInGetIdByName - get id of wav input device, lookup by name
  173. // <lpszName> (i) device name
  174. #ifdef _WIN32
  175. // NULL or TEXT("") get preferred device id
  176. #endif
  177. // <dwFlags> (i) reserved; must be zero
  178. // return device id (-1 if error)
  179. //
  180. int WINAPI WavInGetIdByName(LPCTSTR lpszName, DWORD dwFlags);
  181. // WavInSupportsFormat - return TRUE if device supports specified format
  182. // <hWavIn> (i) handle returned from WavInOpen
  183. // NULL use unopened device specified in <idDev>
  184. // <idDev> (i) device id (ignored if <hWavIn> is not NULL)
  185. // -1 any suitable input device
  186. // <lpwfx> (i) wave format
  187. // return TRUE if device supports specified format
  188. //
  189. BOOL DLLEXPORT WINAPI WavInSupportsFormat(HWAVIN hWavIn, int idDev,
  190. LPWAVEFORMATEX lpwfx);
  191. // WavInFormatSuggest - suggest a new format which the device supports
  192. // <hWavIn> (i) handle returned from WavInOpen
  193. // NULL use unopened device specified in <idDev>
  194. // <idDev> (i) device id (ignored if <hWavIn> is not NULL)
  195. // -1 any suitable input device
  196. // <lpwfxSrc> (i) source format
  197. // <dwFlags> (i) control flags
  198. // WAVIN_NOACM do not use audio compression manager
  199. // return pointer to suggested format, NULL if error
  200. //
  201. // NOTE: the format structure returned is dynamically allocated.
  202. // Use WavFormatFree() to free the buffer.
  203. //
  204. LPWAVEFORMATEX DLLEXPORT WINAPI WavInFormatSuggest(
  205. HWAVIN hWavIn, int idDev, LPWAVEFORMATEX lpwfxSrc, DWORD dwFlags);
  206. // WavInTerm - shut down wav input residuals, if any
  207. // <hInst> (i) instance handle of calling module
  208. // <dwFlags> (i) control flags
  209. // WAV_TELTHUNK terminate telephone thunking layer
  210. // return 0 if success
  211. //
  212. int DLLEXPORT WINAPI WavInTerm(HINSTANCE hInst, DWORD dwFlags);
  213. #ifdef __cplusplus
  214. }
  215. #endif
  216. #endif // __WAVIN_H__