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.

607 lines
28 KiB

  1. /************************************************************************
  2. * *
  3. * dmusicc.h -- This module defines the DirectMusic core API's *
  4. * *
  5. * Copyright (c) 1998, Microsoft Corp. All rights reserved. *
  6. * *
  7. ************************************************************************/
  8. #ifndef _DMUSICC_
  9. #define _DMUSICC_
  10. #include <windows.h>
  11. #define COM_NO_WINDOWS_H
  12. #include <objbase.h>
  13. #include <mmsystem.h>
  14. #include "dls1.h"
  15. #include "dmerror.h"
  16. #include "dmdls.h"
  17. #include "dsound.h"
  18. #include "dmusbuff.h"
  19. #include <pshpack8.h>
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. #define DMUS_MAX_DESCRIPTION 128
  24. #define DMUS_MAX_DRIVER 128
  25. typedef struct _DMUS_BUFFERDESC *LPDMUS_BUFFERDESC;
  26. typedef struct _DMUS_BUFFERDESC{
  27. DWORD dwSize;
  28. DWORD dwFlags;
  29. GUID guidBufferFormat;
  30. DWORD cbBuffer;
  31. } DMUS_BUFFERDESC;
  32. /* DMUS_EFFECT_ flags are used in the dwEffectFlags fields of both DMUS_PORTCAPS
  33. * and DMUS_PORTPARAMS.
  34. */
  35. #define DMUS_EFFECT_NONE 0x00000000
  36. #define DMUS_EFFECT_REVERB 0x00000001
  37. #define DMUS_EFFECT_CHORUS 0x00000002
  38. /* For DMUS_PORTCAPS dwClass
  39. */
  40. #define DMUS_PC_INPUTCLASS (0)
  41. #define DMUS_PC_OUTPUTCLASS (1)
  42. /* For DMUS_PORTCAPS dwFlags
  43. */
  44. #define DMUS_PC_DLS (0x00000001)
  45. #define DMUS_PC_EXTERNAL (0x00000002)
  46. #define DMUS_PC_SOFTWARESYNTH (0x00000004)
  47. #define DMUS_PC_MEMORYSIZEFIXED (0x00000008)
  48. #define DMUS_PC_GMINHARDWARE (0x00000010)
  49. #define DMUS_PC_GSINHARDWARE (0x00000020)
  50. #define DMUS_PC_XGINHARDWARE (0x00000040)
  51. #define DMUS_PC_DIRECTSOUND (0x00000080)
  52. #define DMUS_PC_SHAREABLE (0x00000100)
  53. #define DMUS_PC_DLS2 (0x00000200)
  54. #define DMUS_PC_SYSTEMMEMORY (0x7FFFFFFF)
  55. typedef struct _DMUS_PORTCAPS *LPDMUS_PORTCAPS;
  56. typedef struct _DMUS_PORTCAPS
  57. {
  58. DWORD dwSize;
  59. DWORD dwFlags;
  60. GUID guidPort;
  61. DWORD dwClass;
  62. DWORD dwType;
  63. DWORD dwMemorySize;
  64. DWORD dwMaxChannelGroups;
  65. DWORD dwMaxVoices;
  66. DWORD dwMaxAudioChannels;
  67. DWORD dwEffectFlags;
  68. WCHAR wszDescription[DMUS_MAX_DESCRIPTION];
  69. } DMUS_PORTCAPS;
  70. /* Values for DMUS_PORTCAPS dwType. This field indicates the underlying
  71. * driver type of the port.
  72. */
  73. #define DMUS_PORT_WINMM_DRIVER (0)
  74. #define DMUS_PORT_USER_MODE_SYNTH (1)
  75. #define DMUS_PORT_KERNEL_MODE (2)
  76. /* These flags (set in dwValidParams) indicate which other members of the */
  77. /* DMUS_PORTPARAMS are valid. */
  78. /* */
  79. #define DMUS_PORTPARAMS_VOICES 0x00000001
  80. #define DMUS_PORTPARAMS_CHANNELGROUPS 0x00000002
  81. #define DMUS_PORTPARAMS_AUDIOCHANNELS 0x00000004
  82. #define DMUS_PORTPARAMS_SAMPLERATE 0x00000008
  83. #define DMUS_PORTPARAMS_EFFECTS 0x00000020
  84. #define DMUS_PORTPARAMS_SHARE 0x00000040
  85. typedef struct _DMUS_PORTPARAMS *LPDMUS_PORTPARAMS;
  86. typedef struct _DMUS_PORTPARAMS
  87. {
  88. DWORD dwSize;
  89. DWORD dwValidParams;
  90. DWORD dwVoices;
  91. DWORD dwChannelGroups;
  92. DWORD dwAudioChannels;
  93. DWORD dwSampleRate;
  94. DWORD dwEffectFlags;
  95. BOOL fShare;
  96. } DMUS_PORTPARAMS;
  97. typedef struct _DMUS_SYNTHSTATS *LPDMUS_SYNTHSTATS;
  98. typedef struct _DMUS_SYNTHSTATS
  99. {
  100. DWORD dwSize; /* Size in bytes of the structure */
  101. DWORD dwValidStats; /* Flags indicating which fields below are valid. */
  102. DWORD dwVoices; /* Average number of voices playing. */
  103. DWORD dwTotalCPU; /* Total CPU usage as percent * 100. */
  104. DWORD dwCPUPerVoice; /* CPU per voice as percent * 100. */
  105. DWORD dwLostNotes; /* Number of notes lost in 1 second. */
  106. DWORD dwFreeMemory; /* Free memory in bytes */
  107. long lPeakVolume; /* Decibel level * 100. */
  108. } DMUS_SYNTHSTATS;
  109. #define DMUS_SYNTHSTATS_VOICES (1 << 0)
  110. #define DMUS_SYNTHSTATS_TOTAL_CPU (1 << 1)
  111. #define DMUS_SYNTHSTATS_CPU_PER_VOICE (1 << 2)
  112. #define DMUS_SYNTHSTATS_LOST_NOTES (1 << 3)
  113. #define DMUS_SYNTHSTATS_PEAK_VOLUME (1 << 4)
  114. #define DMUS_SYNTHSTATS_FREE_MEMORY (1 << 5)
  115. #define DMUS_SYNTHSTATS_SYSTEMMEMORY DMUS_PC_SYSTEMMEMORY
  116. typedef struct _DMUS_WAVES_REVERB_PARAMS
  117. {
  118. float fInGain; /* Input gain in dB (to avoid output overflows) */
  119. float fReverbMix; /* Reverb mix in dB. 0dB means 100% wet reverb (no direct signal)
  120. Negative values gives less wet signal.
  121. The coeficients are calculated so that the overall output level stays
  122. (approximately) constant regardless of the ammount of reverb mix. */
  123. float fReverbTime; /* The reverb decay time, in milliseconds. */
  124. float fHighFreqRTRatio; /* The ratio of the high frequencies to the global reverb time.
  125. Unless very 'splashy-bright' reverbs are wanted, this should be set to
  126. a value < 1.0.
  127. For example if dRevTime==1000ms and dHighFreqRTRatio=0.1 than the
  128. decay time for high frequencies will be 100ms.*/
  129. } DMUS_WAVES_REVERB_PARAMS;
  130. /* Note: Default values for Reverb are:
  131. fInGain = 0.0dB (no change in level)
  132. fReverbMix = -10.0dB (a reasonable reverb mix)
  133. fReverbTime = 1000.0ms (one second global reverb time)
  134. fHighFreqRTRatio = 0.001 (the ratio of the high frequencies to the global reverb time)
  135. */
  136. typedef enum
  137. {
  138. DMUS_CLOCK_SYSTEM = 0,
  139. DMUS_CLOCK_WAVE = 1
  140. } DMUS_CLOCKTYPE;
  141. typedef struct _DMUS_CLOCKINFO *LPDMUS_CLOCKINFO;
  142. typedef struct _DMUS_CLOCKINFO
  143. {
  144. DWORD dwSize;
  145. DMUS_CLOCKTYPE ctType;
  146. GUID guidClock; /* Identifies this time source */
  147. WCHAR wszDescription[DMUS_MAX_DESCRIPTION];
  148. } DMUS_CLOCKINFO;
  149. interface IDirectMusic;
  150. interface IDirectMusicBuffer;
  151. interface IDirectMusicPort;
  152. interface IDirectMusicThru;
  153. interface IReferenceClock;
  154. #ifndef __cplusplus
  155. typedef interface IDirectMusic IDirectMusic;
  156. typedef interface IDirectMusicBuffer IDirectMusicBuffer;
  157. typedef interface IDirectMusicPort IDirectMusicPort;
  158. typedef interface IDirectMusicThru IDirectMusicThru;
  159. typedef interface IReferenceClock IReferenceClock;
  160. #endif
  161. typedef IDirectMusic *LPDIRECTMUSIC;
  162. typedef IDirectMusicBuffer *LPDIRECTMUSICBUFFER;
  163. typedef IDirectMusicPort *LPDIRECTMUSICPORT;
  164. #undef INTERFACE
  165. #define INTERFACE IDirectMusic
  166. DECLARE_INTERFACE_(IDirectMusic, IUnknown)
  167. {
  168. /* IUnknown */
  169. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  170. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  171. STDMETHOD_(ULONG,Release) (THIS) PURE;
  172. /* IDirectMusic */
  173. STDMETHOD(EnumPort) (THIS_ DWORD dwIndex,
  174. LPDMUS_PORTCAPS pPortCaps) PURE;
  175. STDMETHOD(CreateMusicBuffer) (THIS_ LPDMUS_BUFFERDESC pBufferDesc,
  176. LPDIRECTMUSICBUFFER *ppBuffer,
  177. LPUNKNOWN pUnkOuter) PURE;
  178. STDMETHOD(CreatePort) (THIS_ REFCLSID rclsidPort,
  179. LPDMUS_PORTPARAMS pPortParams,
  180. LPDIRECTMUSICPORT *ppPort,
  181. LPUNKNOWN pUnkOuter) PURE;
  182. STDMETHOD(EnumMasterClock) (THIS_ DWORD dwIndex,
  183. LPDMUS_CLOCKINFO lpClockInfo) PURE;
  184. STDMETHOD(GetMasterClock) (THIS_ LPGUID pguidClock,
  185. IReferenceClock **ppReferenceClock) PURE;
  186. STDMETHOD(SetMasterClock) (THIS_ REFGUID rguidClock) PURE;
  187. STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE;
  188. STDMETHOD(GetDefaultPort) (THIS_ LPGUID pguidPort) PURE;
  189. STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound,
  190. HWND hWnd) PURE;
  191. };
  192. #undef INTERFACE
  193. #define INTERFACE IDirectMusicBuffer
  194. DECLARE_INTERFACE_(IDirectMusicBuffer, IUnknown)
  195. {
  196. /* IUnknown */
  197. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  198. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  199. STDMETHOD_(ULONG,Release) (THIS) PURE;
  200. /* IDirectMusicBuffer */
  201. STDMETHOD(Flush) (THIS) PURE;
  202. STDMETHOD(TotalTime) (THIS_ LPREFERENCE_TIME prtTime) PURE;
  203. STDMETHOD(PackStructured) (THIS_ REFERENCE_TIME rt,
  204. DWORD dwChannelGroup,
  205. DWORD dwChannelMessage) PURE;
  206. STDMETHOD(PackUnstructured) (THIS_ REFERENCE_TIME rt,
  207. DWORD dwChannelGroup,
  208. DWORD cb,
  209. LPBYTE lpb) PURE;
  210. STDMETHOD(ResetReadPtr) (THIS) PURE;
  211. STDMETHOD(GetNextEvent) (THIS_ LPREFERENCE_TIME prt,
  212. LPDWORD pdwChannelGroup,
  213. LPDWORD pdwLength,
  214. LPBYTE *ppData) PURE;
  215. STDMETHOD(GetRawBufferPtr) (THIS_ LPBYTE *ppData) PURE;
  216. STDMETHOD(GetStartTime) (THIS_ LPREFERENCE_TIME prt) PURE;
  217. STDMETHOD(GetUsedBytes) (THIS_ LPDWORD pcb) PURE;
  218. STDMETHOD(GetMaxBytes) (THIS_ LPDWORD pcb) PURE;
  219. STDMETHOD(GetBufferFormat) (THIS_ LPGUID pGuidFormat) PURE;
  220. STDMETHOD(SetStartTime) (THIS_ REFERENCE_TIME rt) PURE;
  221. STDMETHOD(SetUsedBytes) (THIS_ DWORD cb) PURE;
  222. };
  223. #undef INTERFACE
  224. #define INTERFACE IDirectMusicInstrument
  225. DECLARE_INTERFACE_(IDirectMusicInstrument, IUnknown)
  226. {
  227. /* IUnknown */
  228. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  229. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  230. STDMETHOD_(ULONG,Release) (THIS) PURE;
  231. /* IDirectMusicInstrument */
  232. STDMETHOD(GetPatch) (THIS_ DWORD* pdwPatch) PURE;
  233. STDMETHOD(SetPatch) (THIS_ DWORD dwPatch) PURE;
  234. };
  235. #undef INTERFACE
  236. #define INTERFACE IDirectMusicDownloadedInstrument
  237. DECLARE_INTERFACE_(IDirectMusicDownloadedInstrument, IUnknown)
  238. {
  239. /* IUnknown */
  240. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  241. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  242. STDMETHOD_(ULONG,Release) (THIS) PURE;
  243. /* IDirectMusicDownloadedInstrument */
  244. /* None at this time */
  245. };
  246. #undef INTERFACE
  247. #define INTERFACE IDirectMusicCollection
  248. DECLARE_INTERFACE_(IDirectMusicCollection, IUnknown)
  249. {
  250. /* IUnknown */
  251. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  252. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  253. STDMETHOD_(ULONG,Release) (THIS) PURE;
  254. /* IDirectMusicCollection */
  255. STDMETHOD(GetInstrument) (THIS_ DWORD dwPatch,
  256. IDirectMusicInstrument** ppInstrument) PURE;
  257. STDMETHOD(EnumInstrument) (THIS_ DWORD dwIndex,
  258. DWORD* pdwPatch,
  259. LPWSTR pwszName,
  260. DWORD dwNameLen) PURE;
  261. };
  262. #undef INTERFACE
  263. #define INTERFACE IDirectMusicDownload
  264. DECLARE_INTERFACE_(IDirectMusicDownload , IUnknown)
  265. {
  266. /* IUnknown */
  267. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  268. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  269. STDMETHOD_(ULONG,Release) (THIS) PURE;
  270. /* IDirectMusicDownload */
  271. STDMETHOD(GetBuffer) (THIS_ void** ppvBuffer,
  272. DWORD* pdwSize) PURE;
  273. };
  274. #undef INTERFACE
  275. #define INTERFACE IDirectMusicPortDownload
  276. DECLARE_INTERFACE_(IDirectMusicPortDownload, IUnknown)
  277. {
  278. /* IUnknown */
  279. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  280. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  281. STDMETHOD_(ULONG,Release) (THIS) PURE;
  282. /* IDirectMusicPortDownload */
  283. STDMETHOD(GetBuffer) (THIS_ DWORD dwDLId,
  284. IDirectMusicDownload** ppIDMDownload) PURE;
  285. STDMETHOD(AllocateBuffer) (THIS_ DWORD dwSize,
  286. IDirectMusicDownload** ppIDMDownload) PURE;
  287. STDMETHOD(GetDLId) (THIS_ DWORD* pdwStartDLId,
  288. DWORD dwCount) PURE;
  289. STDMETHOD(GetAppend) (THIS_ DWORD* pdwAppend) PURE;
  290. STDMETHOD(Download) (THIS_ IDirectMusicDownload* pIDMDownload) PURE;
  291. STDMETHOD(Unload) (THIS_ IDirectMusicDownload* pIDMDownload) PURE;
  292. };
  293. /* Standard values for voice priorities. Numerically higher priorities are higher in priority.
  294. * These priorities are used to set the voice priority for all voices on a channel. They are
  295. * used in the dwPriority parameter of IDirectMusicPort::GetPriority and returned in the
  296. * lpwPriority parameter of pdwPriority.
  297. *
  298. * These priorities are shared with DirectSound.
  299. */
  300. #ifndef _DIRECTAUDIO_PRIORITIES_DEFINED_
  301. #define _DIRECTAUDIO_PRIORITIES_DEFINED_
  302. #define DAUD_CRITICAL_VOICE_PRIORITY (0xF0000000)
  303. #define DAUD_HIGH_VOICE_PRIORITY (0xC0000000)
  304. #define DAUD_STANDARD_VOICE_PRIORITY (0x80000000)
  305. #define DAUD_LOW_VOICE_PRIORITY (0x40000000)
  306. #define DAUD_PERSIST_VOICE_PRIORITY (0x10000000)
  307. /* These are the default priorities assigned if not overridden. By default priorities are
  308. * equal across channel groups (e.g. channel 5 on channel group 1 has the same priority as
  309. * channel 5 on channel group 2).
  310. *
  311. * In accordance with DLS level 1, channel 10 has the highest priority, followed by 1 through 16
  312. * except for 10.
  313. */
  314. #define DAUD_CHAN1_VOICE_PRIORITY_OFFSET (0x0000000E)
  315. #define DAUD_CHAN2_VOICE_PRIORITY_OFFSET (0x0000000D)
  316. #define DAUD_CHAN3_VOICE_PRIORITY_OFFSET (0x0000000C)
  317. #define DAUD_CHAN4_VOICE_PRIORITY_OFFSET (0x0000000B)
  318. #define DAUD_CHAN5_VOICE_PRIORITY_OFFSET (0x0000000A)
  319. #define DAUD_CHAN6_VOICE_PRIORITY_OFFSET (0x00000009)
  320. #define DAUD_CHAN7_VOICE_PRIORITY_OFFSET (0x00000008)
  321. #define DAUD_CHAN8_VOICE_PRIORITY_OFFSET (0x00000007)
  322. #define DAUD_CHAN9_VOICE_PRIORITY_OFFSET (0x00000006)
  323. #define DAUD_CHAN10_VOICE_PRIORITY_OFFSET (0x0000000F)
  324. #define DAUD_CHAN11_VOICE_PRIORITY_OFFSET (0x00000005)
  325. #define DAUD_CHAN12_VOICE_PRIORITY_OFFSET (0x00000004)
  326. #define DAUD_CHAN13_VOICE_PRIORITY_OFFSET (0x00000003)
  327. #define DAUD_CHAN14_VOICE_PRIORITY_OFFSET (0x00000002)
  328. #define DAUD_CHAN15_VOICE_PRIORITY_OFFSET (0x00000001)
  329. #define DAUD_CHAN16_VOICE_PRIORITY_OFFSET (0x00000000)
  330. #define DAUD_CHAN1_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN1_VOICE_PRIORITY_OFFSET)
  331. #define DAUD_CHAN2_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN2_VOICE_PRIORITY_OFFSET)
  332. #define DAUD_CHAN3_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN3_VOICE_PRIORITY_OFFSET)
  333. #define DAUD_CHAN4_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN4_VOICE_PRIORITY_OFFSET)
  334. #define DAUD_CHAN5_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN5_VOICE_PRIORITY_OFFSET)
  335. #define DAUD_CHAN6_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN6_VOICE_PRIORITY_OFFSET)
  336. #define DAUD_CHAN7_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN7_VOICE_PRIORITY_OFFSET)
  337. #define DAUD_CHAN8_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN8_VOICE_PRIORITY_OFFSET)
  338. #define DAUD_CHAN9_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN9_VOICE_PRIORITY_OFFSET)
  339. #define DAUD_CHAN10_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN10_VOICE_PRIORITY_OFFSET)
  340. #define DAUD_CHAN11_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN11_VOICE_PRIORITY_OFFSET)
  341. #define DAUD_CHAN12_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN12_VOICE_PRIORITY_OFFSET)
  342. #define DAUD_CHAN13_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN13_VOICE_PRIORITY_OFFSET)
  343. #define DAUD_CHAN14_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN14_VOICE_PRIORITY_OFFSET)
  344. #define DAUD_CHAN15_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN15_VOICE_PRIORITY_OFFSET)
  345. #define DAUD_CHAN16_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN16_VOICE_PRIORITY_OFFSET)
  346. #endif /* _DIRECTAUDIO_PRIORITIES_DEFINED_ */
  347. #undef INTERFACE
  348. #define INTERFACE IDirectMusicPort
  349. DECLARE_INTERFACE_(IDirectMusicPort, IUnknown)
  350. {
  351. /* IUnknown */
  352. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  353. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  354. STDMETHOD_(ULONG,Release) (THIS) PURE;
  355. /* IDirectMusicPort */
  356. /* */
  357. STDMETHOD(PlayBuffer) (THIS_ LPDIRECTMUSICBUFFER pBuffer) PURE;
  358. STDMETHOD(SetReadNotificationHandle) (THIS_ HANDLE hEvent) PURE;
  359. STDMETHOD(Read) (THIS_ LPDIRECTMUSICBUFFER pBuffer) PURE;
  360. STDMETHOD(DownloadInstrument) (THIS_ IDirectMusicInstrument *pInstrument,
  361. IDirectMusicDownloadedInstrument **ppDownloadedInstrument,
  362. DMUS_NOTERANGE *pNoteRanges,
  363. DWORD dwNumNoteRanges) PURE;
  364. STDMETHOD(UnloadInstrument) (THIS_ IDirectMusicDownloadedInstrument *pDownloadedInstrument) PURE;
  365. STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE;
  366. STDMETHOD(GetRunningStats) (THIS_ LPDMUS_SYNTHSTATS pStats) PURE;
  367. STDMETHOD(Compact) (THIS) PURE;
  368. STDMETHOD(GetCaps) (THIS_ LPDMUS_PORTCAPS pPortCaps) PURE;
  369. STDMETHOD(DeviceIoControl) (THIS_ DWORD dwIoControlCode,
  370. LPVOID lpInBuffer,
  371. DWORD nInBufferSize,
  372. LPVOID lpOutBuffer,
  373. DWORD nOutBufferSize,
  374. LPDWORD lpBytesReturned,
  375. LPOVERLAPPED lpOverlapped) PURE;
  376. STDMETHOD(SetNumChannelGroups) (THIS_ DWORD dwChannelGroups) PURE;
  377. STDMETHOD(GetNumChannelGroups) (THIS_ LPDWORD pdwChannelGroups) PURE;
  378. STDMETHOD(Activate) (THIS_ BOOL fActive) PURE;
  379. STDMETHOD(SetChannelPriority) (THIS_ DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority) PURE;
  380. STDMETHOD(GetChannelPriority) (THIS_ DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority) PURE;
  381. STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer) PURE;
  382. STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSize, LPDWORD pdwBufferSize) PURE;
  383. };
  384. #undef INTERFACE
  385. #define INTERFACE IDirectMusicThru
  386. DECLARE_INTERFACE_(IDirectMusicThru, IUnknown)
  387. {
  388. /* IUnknown */
  389. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  390. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  391. STDMETHOD_(ULONG,Release) (THIS) PURE;
  392. /* IDirectMusicThru
  393. */
  394. STDMETHOD(ThruChannel) (THIS_ DWORD dwSourceChannelGroup,
  395. DWORD dwSourceChannel,
  396. DWORD dwDestinationChannelGroup,
  397. DWORD dwDestinationChannel,
  398. LPDIRECTMUSICPORT pDestinationPort) PURE;
  399. };
  400. #ifndef __IReferenceClock_INTERFACE_DEFINED__
  401. #define __IReferenceClock_INTERFACE_DEFINED__
  402. DEFINE_GUID(IID_IReferenceClock,0x56a86897,0x0ad4,0x11ce,0xb0,0x3a,0x00,0x20,0xaf,0x0b,0xa7,0x70);
  403. #undef INTERFACE
  404. #define INTERFACE IReferenceClock
  405. DECLARE_INTERFACE_(IReferenceClock, IUnknown)
  406. {
  407. /* IUnknown */
  408. STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  409. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  410. STDMETHOD_(ULONG,Release) (THIS) PURE;
  411. /* IReferenceClock */
  412. /* */
  413. /* get the time now */
  414. STDMETHOD(GetTime) (THIS_ REFERENCE_TIME *pTime) PURE;
  415. /* ask for an async notification that a time has elapsed */
  416. STDMETHOD(AdviseTime) (THIS_ REFERENCE_TIME baseTime, /* base time */
  417. REFERENCE_TIME streamTime, /* stream offset time */
  418. HANDLE hEvent, /* advise via this event */
  419. DWORD * pdwAdviseCookie) PURE; /* where your cookie goes */
  420. /* ask for an async periodic notification that a time has elapsed */
  421. STDMETHOD(AdvisePeriodic) (THIS_ REFERENCE_TIME startTime, /* starting at this time */
  422. REFERENCE_TIME periodTime, /* time between notifications */
  423. HANDLE hSemaphore, /* advise via a semaphore */
  424. DWORD * pdwAdviseCookie) PURE; /* where your cookie goes */
  425. /* cancel a request for notification */
  426. STDMETHOD(Unadvise) (THIS_ DWORD dwAdviseCookie) PURE;
  427. };
  428. #endif /* __IReferenceClock_INTERFACE_DEFINED__ */
  429. DEFINE_GUID(CLSID_DirectMusic,0x636b9f10,0x0c7d,0x11d1,0x95,0xb2,0x00,0x20,0xaf,0xdc,0x74,0x21);
  430. DEFINE_GUID(CLSID_DirectMusicCollection,0x480ff4b0, 0x28b2, 0x11d1, 0xbe, 0xf7, 0x0, 0xc0, 0x4f, 0xbf, 0x8f, 0xef);
  431. DEFINE_GUID(CLSID_DirectMusicSynth,0x58C2B4D0,0x46E7,0x11D1,0x89,0xAC,0x00,0xA0,0xC9,0x05,0x41,0x29);
  432. DEFINE_GUID(IID_IDirectMusic,0x6536115a,0x7b2d,0x11d2,0xba,0x18,0x00,0x00,0xf8,0x75,0xac,0x12);
  433. DEFINE_GUID(IID_IDirectMusicBuffer,0xd2ac2878, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  434. DEFINE_GUID(IID_IDirectMusicPort, 0x08f2d8c9,0x37c2,0x11d2,0xb9,0xf9,0x00,0x00,0xf8,0x75,0xac,0x12);
  435. DEFINE_GUID(IID_IDirectMusicThru, 0xced153e7, 0x3606, 0x11d2, 0xb9, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
  436. DEFINE_GUID(IID_IDirectMusicPortDownload,0xd2ac287a, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  437. DEFINE_GUID(IID_IDirectMusicDownload,0xd2ac287b, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  438. DEFINE_GUID(IID_IDirectMusicCollection,0xd2ac287c, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  439. DEFINE_GUID(IID_IDirectMusicInstrument,0xd2ac287d, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  440. DEFINE_GUID(IID_IDirectMusicDownloadedInstrument,0xd2ac287e, 0xb39b, 0x11d1, 0x87, 0x4, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  441. /* Alternate interface ID for IID_IDirectMusic, available in DX7 release and after. */
  442. DEFINE_GUID(IID_IDirectMusic2,0x6fc2cae1, 0xbc78, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
  443. /* Property Query GUID_DMUS_PROP_GM_Hardware - Local GM set, no need to download
  444. * Property Query GUID_DMUS_PROP_GS_Hardware - Local GS set, no need to download
  445. * Property Query GUID_DMUS_PROP_XG_Hardware - Local XG set, no need to download
  446. * Property Query GUID_DMUS_PROP_DLS1 - Support DLS level 1
  447. * Property Query GUID_DMUS_PROP_INSTRUMENT2 - Support new INSTRUMENT2 download format
  448. * Property Query GUID_DMUS_PROP_XG_Capable - Support minimum requirements of XG
  449. * Property Query GUID_DMUS_PROP_GS_Capable - Support minimum requirements of GS
  450. * Property Query GUID_DMUS_PROP_SynthSink_DSOUND - Synthsink talks to DSound
  451. * Property Query GUID_DMUS_PROP_SynthSink_WAVE - Synthsink talks to Wave device
  452. *
  453. * Item 0: Supported
  454. * Returns a DWORD which is non-zero if the feature is supported
  455. */
  456. DEFINE_GUID(GUID_DMUS_PROP_GM_Hardware, 0x178f2f24, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
  457. DEFINE_GUID(GUID_DMUS_PROP_GS_Hardware, 0x178f2f25, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
  458. DEFINE_GUID(GUID_DMUS_PROP_XG_Hardware, 0x178f2f26, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
  459. DEFINE_GUID(GUID_DMUS_PROP_XG_Capable, 0x6496aba1, 0x61b0, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
  460. DEFINE_GUID(GUID_DMUS_PROP_GS_Capable, 0x6496aba2, 0x61b0, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
  461. DEFINE_GUID(GUID_DMUS_PROP_DLS1, 0x178f2f27, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
  462. DEFINE_GUID(GUID_DMUS_PROP_DLS2, 0xf14599e5, 0x4689, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
  463. DEFINE_GUID(GUID_DMUS_PROP_INSTRUMENT2, 0x865fd372, 0x9f67, 0x11d2, 0x87, 0x2a, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  464. DEFINE_GUID(GUID_DMUS_PROP_SynthSink_DSOUND,0xaa97844, 0xc877, 0x11d1, 0x87, 0xc, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  465. DEFINE_GUID(GUID_DMUS_PROP_SynthSink_WAVE,0xaa97845, 0xc877, 0x11d1, 0x87, 0xc, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  466. DEFINE_GUID(GUID_DMUS_PROP_SampleMemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
  467. DEFINE_GUID(GUID_DMUS_PROP_SamplePlaybackRate, 0x2a91f713, 0xa4bf, 0x11d2, 0xbb, 0xdf, 0x0, 0x60, 0x8, 0x33, 0xdb, 0xd8);
  468. /* Property Get/Set GUID_DMUS_PROP_WriteLatency
  469. *
  470. * Item 0: Synth buffer write latency, in milliseconds
  471. * Get/Set SynthSink latency, the average time after the play head that the next buffer gets written.
  472. */
  473. DEFINE_GUID(GUID_DMUS_PROP_WriteLatency,0x268a0fa0, 0x60f2, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
  474. /* Property Get/Set GUID_DMUS_PROP_WritePeriod
  475. *
  476. * Item 0: Synth buffer write period, in milliseconds
  477. * Get/Set SynthSink buffer write period, time span between successive writes.
  478. */
  479. DEFINE_GUID(GUID_DMUS_PROP_WritePeriod,0x268a0fa1, 0x60f2, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
  480. /* Property Get GUID_DMUS_PROP_MemorySize
  481. *
  482. * Item 0: Memory size
  483. * Returns a DWORD containing the total number of bytes of sample RAM
  484. */
  485. DEFINE_GUID(GUID_DMUS_PROP_MemorySize, 0x178f2f28, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
  486. /* Property Set GUID_DMUS_PROP_WavesReverb
  487. *
  488. * Item 0: DMUS_WAVES_REVERB structure
  489. * Sets reverb parameters
  490. */
  491. DEFINE_GUID(GUID_DMUS_PROP_WavesReverb,0x4cb5622, 0x32e5, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
  492. /* Property Set GUID_DMUS_PROP_Effects
  493. *
  494. * Item 0: DWORD with effects flags.
  495. * Get/Set effects bits, same as dwEffectFlags in DMUS_PORTPARAMS and DMUS_PORTCAPS:
  496. * DMUS_EFFECT_NONE
  497. * DMUS_EFFECT_REVERB
  498. * DMUS_EFFECT_CHORUS
  499. */
  500. DEFINE_GUID(GUID_DMUS_PROP_Effects, 0xcda8d611, 0x684a, 0x11d2, 0x87, 0x1e, 0x0, 0x60, 0x8, 0x93, 0xb1, 0xbd);
  501. /* Property Set GUID_DMUS_PROP_LegacyCaps
  502. *
  503. * Item 0: The MIDINCAPS or MIDIOUTCAPS which describes the port's underlying WinMM device. This property is only supported
  504. * by ports which wrap WinMM devices.
  505. */
  506. DEFINE_GUID(GUID_DMUS_PROP_LegacyCaps,0xcfa7cdc2, 0x00a1, 0x11d2, 0xaa, 0xd5, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
  507. /* Property Set GUID_DMUS_PROP_Volume
  508. *
  509. * Item 0: A long which contains an offset, in 1/100 dB, to be added to the final volume
  510. *
  511. */
  512. DEFINE_GUID(GUID_DMUS_PROP_Volume, 0xfedfae25L, 0xe46e, 0x11d1, 0xaa, 0xce, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
  513. /* Min and Max values for setting volume with GUID_DMUS_PROP_Volume */
  514. #define DMUS_VOLUME_MAX 2000 /* +20 dB */
  515. #define DMUS_VOLUME_MIN -20000 /* -200 dB */
  516. #ifdef __cplusplus
  517. }; /* extern "C" */
  518. #endif
  519. #include <poppack.h>
  520. #endif /* #ifndef _DMUSICC_ */