dmusics.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:9k
源码类别:

模拟服务器

开发平台:

C/C++

  1. /************************************************************************
  2. *                                                                       *
  3. *   dmusics.h -- Definitions for created a DirectMusic software synth   *
  4. *                                                                       *
  5. *   Copyright (c) 1998-1999 Microsoft Corporation
  6. *                                                                       *
  7. ************************************************************************/
  8. #ifndef _DMUSICS_
  9. #define _DMUSICS_
  10. #include "dmusicc.h"
  11. /* Software synths are enumerated from under this registry key.
  12.  */
  13. #define REGSTR_PATH_SOFTWARESYNTHS  "Software\Microsoft\DirectMusic\SoftwareSynths"
  14. interface IDirectMusicSynth;
  15. interface IDirectMusicSynthSink;
  16. #ifndef __cplusplus 
  17. typedef interface IDirectMusicSynth IDirectMusicSynth;
  18. typedef interface IDirectMusicSynthSink IDirectMusicSynthSink;
  19. #endif
  20. #ifndef _DMUS_VOICE_STATE_DEFINED
  21. #define _DMUS_VOICE_STATE_DEFINED
  22. typedef struct _DMUS_VOICE_STATE
  23. {
  24.     BOOL                bExists;
  25.     SAMPLE_POSITION     spPosition;
  26. } DMUS_VOICE_STATE; 
  27. #endif /* _DMUS_VOICE_STATE_DEFINED */
  28. /* IDirectMusicSynth::Refresh
  29.  *
  30.  * This is the last buffer of the stream. It may be a partial block.
  31.  */
  32. #define REFRESH_F_LASTBUFFER        0x00000001
  33. #undef  INTERFACE
  34. #define INTERFACE  IDirectMusicSynth
  35. DECLARE_INTERFACE_(IDirectMusicSynth, IUnknown)
  36. {
  37.     /* IUnknown */
  38.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  39.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  40.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  41.     /* IDirectMusicSynth */
  42.     STDMETHOD(Open)                 (THIS_ LPDMUS_PORTPARAMS pPortParams) PURE;
  43.     STDMETHOD(Close)                (THIS) PURE;
  44.     STDMETHOD(SetNumChannelGroups)  (THIS_ DWORD dwGroups) PURE;
  45.     STDMETHOD(Download)             (THIS_ LPHANDLE phDownload, 
  46.                                            LPVOID pvData, 
  47.                                            LPBOOL pbFree ) PURE;
  48.     STDMETHOD(Unload)               (THIS_ HANDLE hDownload, 
  49.                                            HRESULT ( CALLBACK *lpFreeHandle)(HANDLE,HANDLE), 
  50.                                            HANDLE hUserData ) PURE; 
  51.     STDMETHOD(PlayBuffer)           (THIS_ REFERENCE_TIME rt, 
  52.                                            LPBYTE pbBuffer, 
  53.                                            DWORD cbBuffer) PURE;
  54.     STDMETHOD(GetRunningStats)      (THIS_ LPDMUS_SYNTHSTATS pStats) PURE;
  55.     STDMETHOD(GetPortCaps)          (THIS_ LPDMUS_PORTCAPS pCaps) PURE;
  56.     STDMETHOD(SetMasterClock)       (THIS_ IReferenceClock *pClock) PURE;
  57.     STDMETHOD(GetLatencyClock)      (THIS_ IReferenceClock **ppClock) PURE;
  58.     STDMETHOD(Activate)             (THIS_ BOOL fEnable) PURE;
  59.     STDMETHOD(SetSynthSink)         (THIS_ IDirectMusicSynthSink *pSynthSink) PURE;
  60.     STDMETHOD(Render)               (THIS_ short *pBuffer, 
  61.                                            DWORD dwLength, 
  62.                                            LONGLONG llPosition) PURE;
  63.     STDMETHOD(SetChannelPriority)   (THIS_ DWORD dwChannelGroup,
  64.                                            DWORD dwChannel,
  65.                                            DWORD dwPriority) PURE;
  66.     STDMETHOD(GetChannelPriority)   (THIS_ DWORD dwChannelGroup,
  67.                                            DWORD dwChannel,
  68.                                            LPDWORD pdwPriority) PURE;
  69.     STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX pWaveFormatEx,
  70.                                            LPDWORD pdwWaveFormatExSize) PURE;
  71.     STDMETHOD(GetAppend)            (THIS_ DWORD* pdwAppend) PURE;
  72. };
  73. #undef  INTERFACE
  74. #define INTERFACE  IDirectMusicSynth8
  75. DECLARE_INTERFACE_(IDirectMusicSynth8, IDirectMusicSynth)
  76. {
  77.     /* IUnknown */
  78.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  79.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  80.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  81.     /* IDirectMusicSynth */
  82.     STDMETHOD(Open)                 (THIS_ LPDMUS_PORTPARAMS pPortParams) PURE;
  83.     STDMETHOD(Close)                (THIS) PURE;
  84.     STDMETHOD(SetNumChannelGroups)  (THIS_ DWORD dwGroups) PURE;
  85.     STDMETHOD(Download)             (THIS_ LPHANDLE phDownload, 
  86.                                            LPVOID pvData, 
  87.                                            LPBOOL pbFree ) PURE;
  88.     STDMETHOD(Unload)               (THIS_ HANDLE hDownload, 
  89.                                            HRESULT ( CALLBACK *lpFreeHandle)(HANDLE,HANDLE), 
  90.                                            HANDLE hUserData ) PURE; 
  91.     STDMETHOD(PlayBuffer)           (THIS_ REFERENCE_TIME rt, 
  92.                                            LPBYTE pbBuffer, 
  93.                                            DWORD cbBuffer) PURE;
  94.     STDMETHOD(GetRunningStats)      (THIS_ LPDMUS_SYNTHSTATS pStats) PURE;
  95.     STDMETHOD(GetPortCaps)          (THIS_ LPDMUS_PORTCAPS pCaps) PURE;
  96.     STDMETHOD(SetMasterClock)       (THIS_ IReferenceClock *pClock) PURE;
  97.     STDMETHOD(GetLatencyClock)      (THIS_ IReferenceClock **ppClock) PURE;
  98.     STDMETHOD(Activate)             (THIS_ BOOL fEnable) PURE;
  99.     STDMETHOD(SetSynthSink)         (THIS_ IDirectMusicSynthSink *pSynthSink) PURE;
  100.     STDMETHOD(Render)               (THIS_ short *pBuffer, 
  101.                                            DWORD dwLength, 
  102.                                            LONGLONG llPosition) PURE;
  103.     STDMETHOD(SetChannelPriority)   (THIS_ DWORD dwChannelGroup,
  104.                                            DWORD dwChannel,
  105.                                            DWORD dwPriority) PURE;
  106.     STDMETHOD(GetChannelPriority)   (THIS_ DWORD dwChannelGroup,
  107.                                            DWORD dwChannel,
  108.                                            LPDWORD pdwPriority) PURE;
  109.     STDMETHOD(GetFormat)            (THIS_ LPWAVEFORMATEX pWaveFormatEx,
  110.                                            LPDWORD pdwWaveFormatExSize) PURE;
  111.     STDMETHOD(GetAppend)            (THIS_ DWORD* pdwAppend) PURE;
  112. /* IDirectMusicSynth8 */
  113.     STDMETHOD(PlayVoice)            (THIS_ REFERENCE_TIME rt, 
  114.    DWORD dwVoiceId, 
  115.    DWORD dwChannelGroup, 
  116.    DWORD dwChannel, 
  117.    DWORD dwDLId, 
  118.    long  prPitch, /* PREL not defined here */
  119.    long  vrVolume,          /* VREL not defined here */
  120.                                            SAMPLE_TIME stVoiceStart,
  121.                                            SAMPLE_TIME stLoopStart,
  122.                                            SAMPLE_TIME stLoopEnd) PURE;
  123.     STDMETHOD(StopVoice)            (THIS_ REFERENCE_TIME rt, 
  124.    DWORD dwVoiceId ) PURE;
  125.     STDMETHOD(GetVoiceState)        (THIS_ DWORD dwVoice[], 
  126.    DWORD cbVoice,
  127.    DMUS_VOICE_STATE dwVoiceState[] ) PURE;
  128.     STDMETHOD(Refresh)              (THIS_ DWORD dwDownloadID,
  129.                                            DWORD dwFlags) PURE;
  130.     STDMETHOD(AssignChannelToBuses) (THIS_ DWORD dwChannelGroup,
  131.                                            DWORD dwChannel,
  132.                                            LPDWORD pdwBuses,
  133.                                            DWORD cBuses) PURE;                                           
  134. };
  135. #undef  INTERFACE
  136. #define INTERFACE  IDirectMusicSynthSink
  137. DECLARE_INTERFACE_(IDirectMusicSynthSink, IUnknown)
  138. {
  139.     /* IUnknown */
  140.     STDMETHOD(QueryInterface)       (THIS_ REFIID, LPVOID FAR *) PURE;
  141.     STDMETHOD_(ULONG,AddRef)        (THIS) PURE;
  142.     STDMETHOD_(ULONG,Release)       (THIS) PURE;
  143.     /* IDirectMusicSynthSink */
  144.     STDMETHOD(Init)                 (THIS_ IDirectMusicSynth *pSynth) PURE;
  145.     STDMETHOD(SetMasterClock)       (THIS_ IReferenceClock *pClock) PURE;
  146.     STDMETHOD(GetLatencyClock)      (THIS_ IReferenceClock **ppClock) PURE;
  147.     STDMETHOD(Activate)             (THIS_ BOOL fEnable) PURE;
  148.     STDMETHOD(SampleToRefTime)      (THIS_ LONGLONG llSampleTime,
  149.                                            REFERENCE_TIME *prfTime) PURE;
  150.     STDMETHOD(RefTimeToSample)      (THIS_ REFERENCE_TIME rfTime, 
  151.                                            LONGLONG *pllSampleTime) PURE;
  152.     STDMETHOD(SetDirectSound)       (THIS_ LPDIRECTSOUND pDirectSound,
  153.                                            LPDIRECTSOUNDBUFFER pDirectSoundBuffer) PURE;                                           
  154.     STDMETHOD(GetDesiredBufferSize) (THIS_ LPDWORD pdwBufferSizeInSamples) PURE;                                           
  155. };
  156. DEFINE_GUID(IID_IDirectMusicSynth, 0x9823661,  0x5c85, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
  157. DEFINE_GUID(IID_IDirectMusicSynth8,0x53cab625, 0x2711, 0x4c9f, 0x9d, 0xe7, 0x1b, 0x7f, 0x92, 0x5f, 0x6f, 0xc8);
  158. DEFINE_GUID(IID_IDirectMusicSynthSink,0x9823663, 0x5c85, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6);
  159. /* Property Set GUID_DMUS_PROP_SetSynthSink
  160.  *
  161.  * Item 0: An IUnknown on which the port can QueryInterface for a user-mode synth sink.
  162.  */
  163. DEFINE_GUID(GUID_DMUS_PROP_SetSynthSink,0x0a3a5ba5, 0x37b6, 0x11d2, 0xb9, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12);
  164. /* Property Set GUID_DMUS_PROP_SinkUsesDSound
  165.  *
  166.  * Item 0: A DWORD boolean indicating whether or not the sink requires an IDirectSound interface. The
  167.  * default is FALSE if this property item is not implemented by the sink.
  168.  */
  169. DEFINE_GUID(GUID_DMUS_PROP_SinkUsesDSound, 0xbe208857, 0x8952, 0x11d2, 0xba, 0x1c, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); 
  170. #endif