Source code of Windows XP (NT5)
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.

485 lines
14 KiB

  1. /*
  2. // RSX.H
  3. //
  4. // INTEL CORPORATION PROPRIETARY INFORMATION
  5. // This software is supplied under the terms of a license agreement or
  6. // nondisclosure agreement with Intel Corporation and may not be copied
  7. // or disclosed except in accordance with the terms of that agreement.
  8. //
  9. // Copyright (c) 1996 Intel Corporation. All Rights Reserved.
  10. //
  11. // PVCS:
  12. // $Workfile: rsx.h $
  13. // $Revision: 1.1 $
  14. // $Modtime: Jul 26 1996 14:40:46 $
  15. //
  16. // PURPOSE:
  17. // RSX 2.0 Header
  18. //
  19. // CONTENTS:
  20. // COM Interface declarations
  21. // Data Structures
  22. // Error Codes
  23. //
  24. */
  25. #ifndef __RSX20_INCLUDED__
  26. #define __RSX20_INCLUDED__
  27. #ifdef _WIN32
  28. #define COM_NO_WINDOWS_H
  29. #include <objbase.h>
  30. #else
  31. #define IUnknown void
  32. #endif
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. #include "mmsystem.h"
  37. #ifdef _WIN32
  38. /* {E78F7620-96CB-11cf-A00B-444553540000} */
  39. DEFINE_GUID(CLSID_RSX20,
  40. 0xe78f7620, 0x96cb, 0x11cf, 0xa0, 0xb, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
  41. /* {E78F7629-96CB-11cf-A00B-444553540000} */
  42. DEFINE_GUID(IID_IRSX20,
  43. 0xe78f7629, 0x96cb, 0x11cf, 0xa0, 0xb, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
  44. /* {E78F762D-96CB-11cf-A00B-444553540000} */
  45. DEFINE_GUID(IID_IRSXCachedEmitter,
  46. 0xe78f762d, 0x96cb, 0x11cf, 0xa0, 0xb, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
  47. /* {E78F7630-96CB-11cf-A00B-444553540000} */
  48. DEFINE_GUID(IID_IRSXStreamingEmitter,
  49. 0xe78f7630, 0x96cb, 0x11cf, 0xa0, 0xb, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
  50. /* {E78F7634-96CB-11cf-A00B-444553540000} */
  51. DEFINE_GUID(IID_IRSXDirectListener,
  52. 0xe78f7634, 0x96cb, 0x11cf, 0xa0, 0xb, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
  53. /* {E78F7638-96CB-11cf-A00B-444553540000} */
  54. DEFINE_GUID(IID_IRSXStreamingListener,
  55. 0xe78f7638, 0x96cb, 0x11cf, 0xa0, 0xb, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
  56. #endif
  57. typedef struct IRSX FAR *LPRSX;
  58. typedef struct IRSXCachedEmitter FAR *LPRSXCACHEDEMITTER;
  59. typedef struct IRSXDirectListener FAR *LPRSXDIRECTLISTENER;
  60. typedef struct IRSXStreamingEmitter FAR *LPRSXSTREAMINGEMITTER;
  61. typedef struct IRSXStreamingListener FAR *LPRSXSTREAMINGLISTENER;
  62. typedef struct _RSXBUFFERHDR FAR *LPRSXBUFFERHDR;
  63. typedef struct _RSXCACHEDEMITTERDESC FAR *LPRSXCACHEDEMITTERDESC;
  64. typedef struct _RSXDIRECTLISTENERDESC FAR *LPRSXDIRECTLISTENERDESC;
  65. typedef struct _RSXEMITTERMODEL FAR *LPRSXEMITTERMODEL;
  66. typedef struct _RSXENVIRONMENT FAR *LPRSXENVIRONMENT;
  67. typedef struct _RSXQUERYMEDIAINFO FAR *LPRSXQUERYMEDIAINFO;
  68. typedef struct _RSXREVERBMODEL FAR *LPRSXREVERBMODEL;
  69. typedef struct _RSXSTREAMINGEMITTERDESC FAR *LPRSXSTREAMINGEMITTERDESC;
  70. typedef struct _RSXSTREAMINGLISTENERDESC FAR *LPRSXSTREAMINGLISTENERDESC;
  71. typedef struct _RSXVECTOR3D FAR *LPRSXVECTOR3D;
  72. #define RSX_MAX_NAME_LEN (MAX_PATH)
  73. /*
  74. // Enumerated Types
  75. */
  76. enum RSX_CPU_Budget { RSX_MIN_BUDGET, RSX_LOW_BUDGET, RSX_MODERATE_BUDGET };
  77. #ifdef _WIN32
  78. #undef INTERFACE
  79. #define INTERFACE IRSX
  80. DECLARE_INTERFACE_( IRSX, IUnknown )
  81. {
  82. /*** IUnknown methods ***/
  83. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  84. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  85. STDMETHOD_(ULONG,Release) (THIS) PURE;
  86. /*** IRSX methods ***/
  87. STDMETHOD(CreateCachedEmitter)(THIS_ LPRSXCACHEDEMITTERDESC lpCachedEmitterAttr, LPRSXCACHEDEMITTER FAR *lpCachedEmitterInterface, IUnknown FAR *reserved) PURE;
  88. STDMETHOD(CreateDirectListener)(THIS_ LPRSXDIRECTLISTENERDESC lpDirectListenerAttr, LPRSXDIRECTLISTENER FAR *lpDirectListenerInterface, IUnknown FAR *reserved) PURE;
  89. STDMETHOD(CreateStreamingEmitter)(THIS_ LPRSXSTREAMINGEMITTERDESC lpStreamingEmitterAttr, LPRSXSTREAMINGEMITTER FAR *lpStreamingEmitterInterface, IUnknown FAR *reserved) PURE;
  90. STDMETHOD(CreateStreamingListener)(THIS_ LPRSXSTREAMINGLISTENERDESC lpStreamingListenerAttr, LPRSXSTREAMINGLISTENER FAR *lpStreamingListenerInterface, IUnknown FAR *reserved) PURE;
  91. STDMETHOD(GetEnvironment)(THIS_ LPRSXENVIRONMENT lpEnvAttr) PURE;
  92. STDMETHOD(GetReverb)(THIS_ LPRSXREVERBMODEL lpReverbModel) PURE;
  93. STDMETHOD(SetEnvironment)(THIS_ LPRSXENVIRONMENT lpEnvAttr) PURE;
  94. STDMETHOD(SetReverb)(THIS_ LPRSXREVERBMODEL lpReverbModel) PURE;
  95. };
  96. #endif
  97. /*
  98. // Flags for IRSXCachedEmitter::ControlMedia
  99. //
  100. */
  101. #define RSX_PLAY 0x00000010
  102. #define RSX_PAUSE 0x00000020
  103. #define RSX_RESUME 0x00000040
  104. #define RSX_STOP 0x00000050
  105. #ifdef _WIN32
  106. #undef INTERFACE
  107. #define INTERFACE IRSXCachedEmitter
  108. DECLARE_INTERFACE_( IRSXCachedEmitter, IUnknown )
  109. {
  110. /*** IUnknown methods ***/
  111. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  112. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  113. STDMETHOD_(ULONG,Release) (THIS) PURE;
  114. /*** IRSXEmitter methods ***/
  115. STDMETHOD(GetCPUBudget)(THIS_ enum RSX_CPU_Budget* lpCPUBudget) PURE;
  116. STDMETHOD(GetModel)(THIS_ LPRSXEMITTERMODEL lpEmitterModel) PURE;
  117. STDMETHOD(GetMuteState)(THIS_ LPDWORD lpdwMuteState) PURE;
  118. STDMETHOD(GetOrientation)(THIS_ LPRSXVECTOR3D lpOrientation) PURE;
  119. STDMETHOD(GetPitch)(THIS_ PFLOAT lpfPitch) PURE;
  120. STDMETHOD(GetUserData)(THIS_ LPDWORD lpdwUser) PURE;
  121. STDMETHOD(GetPosition)(THIS_ LPRSXVECTOR3D lpPosition) PURE;
  122. STDMETHOD(QueryMediaState)(THIS_ LPRSXQUERYMEDIAINFO lpQueryMediaInfo) PURE;
  123. STDMETHOD(SetCPUBudget)(THIS_ enum RSX_CPU_Budget CPUBudget) PURE;
  124. STDMETHOD(SetModel)(THIS_ LPRSXEMITTERMODEL lpEmitterModel) PURE;
  125. STDMETHOD(SetMuteState)(THIS_ DWORD dwMuteState) PURE;
  126. STDMETHOD(SetOrientation)(THIS_ LPRSXVECTOR3D lpOrientation) PURE;
  127. STDMETHOD(SetPitch)(THIS_ FLOAT fPitch) PURE;
  128. STDMETHOD(SetPosition)(THIS_ LPRSXVECTOR3D lpPosition) PURE;
  129. /*** IRSXCachedEmitter methods ***/
  130. STDMETHOD(ControlMedia)(THIS_ DWORD dwControl, DWORD nLoops, FLOAT fInitialStartTime) PURE;
  131. STDMETHOD(GetCacheTime)(THIS_ PFLOAT lpfCacheTime) PURE;
  132. STDMETHOD(GetMarkPosition)(THIS_ PFLOAT lpfBeginTime, PFLOAT lpfEndTime) PURE;
  133. STDMETHOD(SetCacheTime)(THIS_ FLOAT fCacheTime) PURE;
  134. STDMETHOD(SetMarkPosition)(THIS_ FLOAT fBeginTime, FLOAT fEndTime) PURE;
  135. };
  136. #endif
  137. #ifdef _WIN32
  138. #undef INTERFACE
  139. #define INTERFACE IRSXStreamingEmitter
  140. DECLARE_INTERFACE_( IRSXStreamingEmitter, IUnknown )
  141. {
  142. /*** IUnknown methods ***/
  143. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  144. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  145. STDMETHOD_(ULONG,Release) (THIS) PURE;
  146. /*** IRSXEmitter methods ***/
  147. STDMETHOD(GetCPUBudget)(THIS_ enum RSX_CPU_Budget* lpCPUBudget) PURE;
  148. STDMETHOD(GetModel)(THIS_ LPRSXEMITTERMODEL lpEmitterModel) PURE;
  149. STDMETHOD(GetMuteState)(THIS_ LPDWORD lpdwMuteState) PURE;
  150. STDMETHOD(GetOrientation)(THIS_ LPRSXVECTOR3D lpOrientation) PURE;
  151. STDMETHOD(GetPitch)(THIS_ PFLOAT lpfPitch) PURE;
  152. STDMETHOD(GetUserData)(THIS_ LPDWORD lpdwUser) PURE;
  153. STDMETHOD(GetPosition)(THIS_ LPRSXVECTOR3D lpPosition) PURE;
  154. STDMETHOD(QueryMediaState)(THIS_ LPRSXQUERYMEDIAINFO lpQueryMediaInfo) PURE;
  155. STDMETHOD(SetCPUBudget)(THIS_ enum RSX_CPU_Budget CPUBudget) PURE;
  156. STDMETHOD(SetModel)(THIS_ LPRSXEMITTERMODEL lpEmitterModel) PURE;
  157. STDMETHOD(SetMuteState)(THIS_ DWORD dwMuteState) PURE;
  158. STDMETHOD(SetOrientation)(THIS_ LPRSXVECTOR3D lpOrientation) PURE;
  159. STDMETHOD(SetPitch)(THIS_ FLOAT fPitch) PURE;
  160. STDMETHOD(SetPosition)(THIS_ LPRSXVECTOR3D lpPosition) PURE;
  161. /*** IRSXCachedEmitter methods ***/
  162. STDMETHOD(Flush)(THIS) PURE;
  163. STDMETHOD(SubmitBuffer)(THIS_ LPRSXBUFFERHDR lpBufferHdr) PURE;
  164. };
  165. #endif
  166. #ifdef _WIN32
  167. #undef INTERFACE
  168. #define INTERFACE IRSXDirectListener
  169. DECLARE_INTERFACE_( IRSXDirectListener, IUnknown )
  170. {
  171. /*** IUnknown methods ***/
  172. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  173. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  174. STDMETHOD_(ULONG,Release) (THIS) PURE;
  175. /*** IRSXListener methods ***/
  176. STDMETHOD(GetOrientation)(THIS_ LPRSXVECTOR3D lpDirection, LPRSXVECTOR3D lpUp) PURE;
  177. STDMETHOD(GetPosition)(THIS_ LPRSXVECTOR3D lpPosition) PURE;
  178. STDMETHOD(GetUserData)(THIS_ LPDWORD lpdwUser) PURE;
  179. STDMETHOD(SetOrientation)(THIS_ LPRSXVECTOR3D lpDirection, LPRSXVECTOR3D lpUp) PURE;
  180. STDMETHOD(SetPosition)(THIS_ LPRSXVECTOR3D lpPosition) PURE;
  181. /*** IRSXDirectListener methods ***/
  182. STDMETHOD(Connect)(THIS) PURE;
  183. STDMETHOD(Disconnect)(THIS) PURE;
  184. };
  185. #endif
  186. #ifdef _WIN32
  187. #undef INTERFACE
  188. #define INTERFACE IRSXStreamingListener
  189. DECLARE_INTERFACE_( IRSXStreamingListener, IUnknown )
  190. {
  191. /*** IUnknown methods ***/
  192. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  193. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  194. STDMETHOD_(ULONG,Release) (THIS) PURE;
  195. /*** IRSXListener methods ***/
  196. STDMETHOD(GetOrientation)(THIS_ LPRSXVECTOR3D lpDirection, LPRSXVECTOR3D lpUp) PURE;
  197. STDMETHOD(GetPosition)(THIS_ LPRSXVECTOR3D lpPosition) PURE;
  198. STDMETHOD(GetUserData)(THIS_ LPDWORD lpdwUser) PURE;
  199. STDMETHOD(SetOrientation)(THIS_ LPRSXVECTOR3D lpDirection, LPRSXVECTOR3D lpUp) PURE;
  200. STDMETHOD(SetPosition)(THIS_ LPRSXVECTOR3D lpPosition) PURE;
  201. /*** IRSXStreamingListener methods ***/
  202. STDMETHOD(RequestBuffer)(THIS_ LPSTR lpBufferA, LPSTR lpBufferB, DWORD dwSizeB) PURE;
  203. };
  204. #endif
  205. /*
  206. // RSXBUFFERHDR
  207. */
  208. typedef struct _RSXBUFFERHDR {
  209. DWORD cbSize; /* structure size */
  210. DWORD dwUser; /* user data */
  211. DWORD dwSize; /* size of data pointed to by lpData */
  212. LPSTR lpData; /* pointer to data */
  213. HANDLE hEventSignal; /* event handle to be signaled when buffer complete */
  214. DWORD dwReserved1; /* reserved for RSX */
  215. DWORD dwReserved2; /* reserved for RSX */
  216. DWORD dwReserved3; /* reserved for RSX */
  217. DWORD dwReserved4; /* reserved for RSX */
  218. DWORD dwReserved5; /* reserved for RSX */
  219. } RSXBUFFERHDR;
  220. /*
  221. // Flags for RSXCACHEDEMITTERDESC and RSXSTREAMINGEMITTERDESC
  222. */
  223. #define RSXEMITTERDESC_NODOPPLER 0x00000001
  224. #define RSXEMITTERDESC_NOATTENUATE 0x00000002
  225. #define RSXEMITTERDESC_NOSPATIALIZE 0x00000004
  226. #define RSXEMITTERDESC_NOREVERB 0x00000008
  227. /*
  228. // Flags for RSXCACHEDEMITTERDESC
  229. */
  230. #define RSXEMITTERDESC_GROUPID 0x00000010
  231. #define RSXEMITTERDESC_PREPROCESS 0x00000020
  232. #define RSXEMITTERDESC_INMEMORY 0x00000040
  233. /*
  234. // RSXCACHEDEMITTERDESC
  235. */
  236. typedef struct _RSXCACHEDEMITTERDESC {
  237. DWORD cbSize; /* structure size */
  238. DWORD dwFlags; /* creation flags */
  239. DWORD dwGroupID; /* synchronization group ID, use zero for no group */
  240. char szFilename[RSX_MAX_NAME_LEN]; /* path */
  241. HANDLE hEventSignal; /* Signaled when play completes */
  242. DWORD dwUser; /* User specific */
  243. } RSXCACHEDEMITTERDESC;
  244. /*
  245. // RSXDIRECTLISTENERDESC
  246. */
  247. typedef struct _RSXDIRECTLISTENERDESC {
  248. DWORD cbSize; /* structure size */
  249. LPWAVEFORMATEX lpwf; /* Requested output format */
  250. HWND hMainWnd; /* Main Window Handle is DirectSound will be used */
  251. DWORD dwUser; /* User specific */
  252. } RSXDIRECTLISTENERDESC;
  253. /*
  254. // RSXEMITTERMODEL
  255. */
  256. typedef struct _RSXEMITTERMODEL {
  257. DWORD cbSize; /* structure size */
  258. float fMinBack; /* min back -- ambient */
  259. float fMinFront; /* min front -- ambient */
  260. float fMaxBack; /* max back -- attenuation */
  261. float fMaxFront; /* max front -- attenuation */
  262. float fIntensity; /* static intensity */
  263. } RSXEMITTERMODEL;
  264. /*
  265. // Flags for RSXENVIRONMENT
  266. */
  267. #define RSXENVIRONMENT_COORDINATESYSTEM 0x00000001
  268. #define RSXENVIRONMENT_SPEEDOFSOUND 0x00000002
  269. #define RSXENVIRONMENT_CPUBUDGET 0x00000004
  270. /*
  271. // RSXENVIRONMENT
  272. */
  273. typedef struct _RSXENVIRONMENT
  274. {
  275. DWORD cbSize; /* structure size */
  276. DWORD dwFlags; /* creation flags */
  277. BOOL bUseRightHand; /* coordinate system */
  278. FLOAT fSpeedOfSound; /* Speed of Sound for Doppler */
  279. enum RSX_CPU_Budget CPUBudget; /* CPU limit for localization */
  280. } RSXENVIRONMENT;
  281. /*
  282. // RSXQUERYMEDIAINFO
  283. */
  284. typedef struct _RSXQUERYMEDIAINFO {
  285. DWORD cbSize; /* structure size */
  286. DWORD dwControl; /* play state */
  287. FLOAT fSecondsPlayed; /* playback position in seconds */
  288. FLOAT fTotalSeconds; /* total play time */
  289. DWORD dwNumLoops; /* loop count */
  290. FLOAT fAudibleLevel; /* audible level */
  291. } RSXQUERYMEDIAINFO;
  292. /*
  293. // RSXREVERBMODEL
  294. */
  295. typedef struct _RSXREVERBMODEL
  296. {
  297. DWORD cbSize; /* structure size */
  298. BOOL bUseReverb; /* is reverb applied */
  299. FLOAT fDecayTime; /* Decay in seconds */
  300. FLOAT fIntensity; /* Gain to model sound absorption */
  301. } RSXREVERBMODEL;
  302. /*
  303. // RSXSTREAMINGEMITTERDESC
  304. */
  305. typedef struct _RSXSTREAMINGEMITTERDESC {
  306. DWORD cbSize; /* structure size */
  307. DWORD dwFlags; /* creation flags */
  308. DWORD dwType; /* unused -- must be zero */
  309. LPWAVEFORMATEX lpwf; /* buffer format */
  310. DWORD dwUser; /* User specific */
  311. } RSXSTREAMINGEMITTERDESC;
  312. /*
  313. // RSXSTREAMINGLISTENERDESC
  314. */
  315. typedef struct _RSXSTREAMINGLISTENERDESC {
  316. DWORD cbSize; /* structure size */
  317. LPWAVEFORMATEX lpwf; /* Requested output format */
  318. DWORD dwRequestedBufferSize; /* Application requested buffer size */
  319. DWORD dwActualBufferSize; /* RSX specified buffer size */
  320. DWORD dwUser; /* User specific */
  321. } RSXSTREAMINGLISTENERDESC;
  322. /*
  323. // RSXVECTOR3D
  324. */
  325. typedef struct _RSXVECTOR3D {
  326. float x;
  327. float y;
  328. float z;
  329. } RSXVECTOR3D;
  330. /*
  331. // Error Codes
  332. //
  333. */
  334. /* no sound driver installed */
  335. #define RSXERR_NODRIVER MAKE_HRESULT( 1, FACILITY_ITF, 10 )
  336. /* wave driver doesn't support format */
  337. #define RSXERR_BADFORMAT MAKE_HRESULT( 1, FACILITY_ITF, 20 )
  338. /* a zero length vector was specified for the orientation */
  339. #define RSXERR_ZEROVECTOR MAKE_HRESULT( 1, FACILITY_ITF, 30 )
  340. /*
  341. // an error occurred opening the wave file specified
  342. // when creating the emitter
  343. */
  344. #define RSXERR_FILENOTFOUND MAKE_HRESULT( 1, FACILITY_ITF, 40 )
  345. #define RSXERR_FILESHARINGVIOLATION MAKE_HRESULT( 1, FACILITY_ITF, 41 )
  346. /* the wave file is corrupted(not valid) */
  347. #define RSXERR_CORRUPTFILE MAKE_HRESULT( 1, FACILITY_ITF, 50 )
  348. /* the listeners orienation vectors are parallel */
  349. #define RSXERR_PARALLELVECTORS MAKE_HRESULT( 1, FACILITY_ITF, 60 )
  350. /* sound resources are allocated or busy */
  351. #define RSXERR_ALLOCATED MAKE_HRESULT( 1, FACILITY_ITF, 70 )
  352. /* An invalid operation was performed while RSX is playing
  353. // a cached emitter
  354. */
  355. #define RSXERR_PLAYING MAKE_HRESULT( 1, FACILITY_ITF, 80 )
  356. #ifdef __cplusplus
  357. };
  358. #endif
  359. #endif