home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / dmusicc.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  27.7 KB  |  610 lines

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