dmusics.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. /*
  2. * DirectMusic Software Synth Definitions
  3. *
  4. * Copyright (C) 2003-2004 Rok Mandeljc
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Library General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  19. */
  20. #ifndef __WINE_DMUSIC_SOFTWARESYNTH_H
  21. #define __WINE_DMUSIC_SOFTWARESYNTH_H
  22. #include <dmusicc.h>
  23. /*****************************************************************************
  24. * Registry path
  25. */
  26. #define REGSTR_PATH_SOFTWARESYNTHS "Software\\Microsoft\\DirectMusic\\SoftwareSynths"
  27. /*****************************************************************************
  28. * Predeclare the interfaces
  29. */
  30. /* IIDs */
  31. DEFINE_GUID(IID_IDirectMusicSynth, 0x09823661,0x5c85,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6);
  32. DEFINE_GUID(IID_IDirectMusicSynth8, 0x53cab625,0x2711,0x4c9f,0x9d,0xe7,0x1b,0x7f,0x92,0x5f,0x6f,0xc8);
  33. DEFINE_GUID(IID_IDirectMusicSynthSink, 0x09823663,0x5c85,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6);
  34. /* typedef definitions */
  35. typedef struct IDirectMusicSynth IDirectMusicSynth, *LPDIRECTMUSICSYNTH;
  36. typedef struct IDirectMusicSynth8 IDirectMusicSynth8, *LPDIRECTMUSICSYNTH8;
  37. typedef struct IDirectMusicSynthSink IDirectMusicSynthSink, *LPDIRECTMUSICSYNTHSINK;
  38. /* GUIDs - property set */
  39. DEFINE_GUID(GUID_DMUS_PROP_SetSynthSink, 0x0a3a5ba5,0x37b6,0x11d2,0xb9,0xf9,0x00,0x00,0xf8,0x75,0xac,0x12);
  40. DEFINE_GUID(GUID_DMUS_PROP_SinkUsesDSound, 0xbe208857,0x8952,0x11d2,0xba,0x1c,0x00,0x00,0xf8,0x75,0xac,0x12);
  41. /*****************************************************************************
  42. * Flags
  43. */
  44. #define REFRESH_F_LASTBUFFER 0x1
  45. /*****************************************************************************
  46. * Structures
  47. */
  48. #ifndef _DMUS_VOICE_STATE_DEFINED
  49. #define _DMUS_VOICE_STATE_DEFINED
  50. /* typedef definition */
  51. typedef struct _DMUS_VOICE_STATE DMUS_VOICE_STATE, *LPDMUS_VOICE_STATE;
  52. /* actual structure */
  53. struct _DMUS_VOICE_STATE {
  54. BOOL bExists;
  55. SAMPLE_POSITION spPosition;
  56. };
  57. #endif /* _DMUS_VOICE_STATE_DEFINED */
  58. /*****************************************************************************
  59. * IDirectMusicSynth interface
  60. */
  61. #define INTERFACE IDirectMusicSynth
  62. DECLARE_INTERFACE_(IDirectMusicSynth,IUnknown)
  63. {
  64. /*** IUnknown methods ***/
  65. STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
  66. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  67. STDMETHOD_(ULONG,Release)(THIS) PURE;
  68. /*** IDirectMusicSynth methods ***/
  69. STDMETHOD(Open)(THIS_ LPDMUS_PORTPARAMS pPortParams) PURE;
  70. STDMETHOD(Close)(THIS) PURE;
  71. STDMETHOD(SetNumChannelGroups)(THIS_ DWORD dwGroups) PURE;
  72. STDMETHOD(Download)(THIS_ LPHANDLE phDownload, LPVOID pvData, LPBOOL pbFree) PURE;
  73. STDMETHOD(Unload)(THIS_ HANDLE hDownload, HRESULT (CALLBACK* lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData) PURE;
  74. STDMETHOD(PlayBuffer)(THIS_ REFERENCE_TIME rt, LPBYTE pbBuffer, DWORD cbBuffer) PURE;
  75. STDMETHOD(GetRunningStats)(THIS_ LPDMUS_SYNTHSTATS pStats) PURE;
  76. STDMETHOD(GetPortCaps)(THIS_ LPDMUS_PORTCAPS pCaps) PURE;
  77. STDMETHOD(SetMasterClock)(THIS_ IReferenceClock *pClock) PURE;
  78. STDMETHOD(GetLatencyClock)(THIS_ IReferenceClock **ppClock) PURE;
  79. STDMETHOD(Activate)(THIS_ BOOL fEnable) PURE;
  80. STDMETHOD(SetSynthSink)(THIS_ IDirectMusicSynthSink *pSynthSink) PURE;
  81. STDMETHOD(Render)(THIS_ short *pBuffer, DWORD dwLength, LONGLONG llPosition) PURE;
  82. STDMETHOD(SetChannelPriority)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority) PURE;
  83. STDMETHOD(GetChannelPriority)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority) PURE;
  84. STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSiz) PURE;
  85. STDMETHOD(GetAppend)(THIS_ DWORD *pdwAppend) PURE;
  86. };
  87. #undef INTERFACE
  88. #if !defined(__cplusplus) || defined(CINTERFACE)
  89. /*** IUnknown methods ***/
  90. #define IDirectMusicSynth_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  91. #define IDirectMusicSynth_AddRef(p) (p)->lpVtbl->AddRef(p)
  92. #define IDirectMusicSynth_Release(p) (p)->lpVtbl->Release(p)
  93. /*** IDirectMusicSynth methods ***/
  94. #define IDirectMusicSynth_Open(p,a) (p)->lpVtbl->Open(p,a)
  95. #define IDirectMusicSynth_Close(p) (p)->lpVtbl->Close(p)
  96. #define IDirectMusicSynth_SetNumChannelGroups(p,a) (p)->lpVtbl->SetNumChannelGroups(p,a)
  97. #define IDirectMusicSynth_Download(p,a,b,c) (p)->lpVtbl->Download(p,a,b,c)
  98. #define IDirectMusicSynth_Unload(p,a,b,c) (p)->lpVtbl->Unload(p,a,b,c)
  99. #define IDirectMusicSynth_PlayBuffer(p,a,b,c) (p)->lpVtbl->PlayBuffer(p,a,b,c)
  100. #define IDirectMusicSynth_GetRunningStats(p,a) (p)->lpVtbl->GetRunningStats(p,a)
  101. #define IDirectMusicSynth_GetPortCaps(p,a) (p)->lpVtbl->GetPortCaps(p,a)
  102. #define IDirectMusicSynth_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a)
  103. #define IDirectMusicSynth_GetLatencyClock(p,a) (p)->lpVtbl->GetLatencyClock(p,a)
  104. #define IDirectMusicSynth_Activate(p,a) (p)->lpVtbl->Activate(p,a)
  105. #define IDirectMusicSynth_SetSynthSink(p,a) (p)->lpVtbl->SetSynthSink(p,a)
  106. #define IDirectMusicSynth_Render(p,a,b,c) (p)->lpVtbl->Render(p,a,b,c)
  107. #define IDirectMusicSynth_SetChannelPriority(p,a,b,c) (p)->lpVtbl->SetChannelPriority(p,a,b,c)
  108. #define IDirectMusicSynth_GetChannelPriority(p,a,b,c) (p)->lpVtbl->GetChannelPriority(p,a,b,c)
  109. #define IDirectMusicSynth_GetFormat(p,a,b) (p)->lpVtbl->GetFormat(p,a,b)
  110. #define IDirectMusicSynth_GetAppend(p,a) (p)->lpVtbl->GetAppend(p,a)
  111. #endif
  112. /*****************************************************************************
  113. * IDirectMusicSynth8 interface
  114. */
  115. #define INTERFACE IDirectMusicSynth8
  116. DECLARE_INTERFACE_(IDirectMusicSynth8,IDirectMusicSynth)
  117. {
  118. /*** IUnknown methods ***/
  119. STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
  120. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  121. STDMETHOD_(ULONG,Release)(THIS) PURE;
  122. /*** IDirectMusicSynth methods ***/
  123. STDMETHOD(Open)(THIS_ LPDMUS_PORTPARAMS pPortParams) PURE;
  124. STDMETHOD(Close)(THIS) PURE;
  125. STDMETHOD(SetNumChannelGroups)(THIS_ DWORD dwGroups) PURE;
  126. STDMETHOD(Download)(THIS_ LPHANDLE phDownload, LPVOID pvData, LPBOOL pbFree) PURE;
  127. STDMETHOD(Unload)(THIS_ HANDLE hDownload, HRESULT (CALLBACK* lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData) PURE;
  128. STDMETHOD(PlayBuffer)(THIS_ REFERENCE_TIME rt, LPBYTE pbBuffer, DWORD cbBuffer) PURE;
  129. STDMETHOD(GetRunningStats)(THIS_ LPDMUS_SYNTHSTATS pStats) PURE;
  130. STDMETHOD(GetPortCaps)(THIS_ LPDMUS_PORTCAPS pCaps) PURE;
  131. STDMETHOD(SetMasterClock)(THIS_ IReferenceClock *pClock) PURE;
  132. STDMETHOD(GetLatencyClock)(THIS_ IReferenceClock **ppClock) PURE;
  133. STDMETHOD(Activate)(THIS_ BOOL fEnable) PURE;
  134. STDMETHOD(SetSynthSink)(THIS_ IDirectMusicSynthSink *pSynthSink) PURE;
  135. STDMETHOD(Render)(THIS_ short *pBuffer, DWORD dwLength, LONGLONG llPosition) PURE;
  136. STDMETHOD(SetChannelPriority)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority) PURE;
  137. STDMETHOD(GetChannelPriority)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority) PURE;
  138. STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSiz) PURE;
  139. STDMETHOD(GetAppend)(THIS_ DWORD *pdwAppend) PURE;
  140. /*** IDirectMusicSynth8 methods ***/
  141. STDMETHOD(PlayVoice)(THIS_ REFERENCE_TIME rt, DWORD dwVoiceId, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwDLId, long prPitch, long vrVolume, SAMPLE_TIME stVoiceStart, SAMPLE_TIME stLoopStart, SAMPLE_TIME stLoopEnd) PURE;
  142. STDMETHOD(StopVoice)(THIS_ REFERENCE_TIME rt, DWORD dwVoiceId) PURE;
  143. STDMETHOD(GetVoiceState)(THIS_ DWORD dwVoice[], DWORD cbVoice, DMUS_VOICE_STATE dwVoiceState[]) PURE;
  144. STDMETHOD(Refresh)(THIS_ DWORD dwDownloadID, DWORD dwFlags) PURE;
  145. STDMETHOD(AssignChannelToBuses)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwBuses, DWORD cBuses) PURE;
  146. };
  147. #undef INTERFACE
  148. #if !defined(__cplusplus) || defined(CINTERFACE)
  149. /*** IUnknown methods ***/
  150. #define IDirectMusicSynth8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  151. #define IDirectMusicSynth8_AddRef(p) (p)->lpVtbl->AddRef(p)
  152. #define IDirectMusicSynth8_Release(p) (p)->lpVtbl->Release(p)
  153. /*** IDirectMusicSynth methods ***/
  154. #define IDirectMusicSynth8_Open(p,a) (p)->lpVtbl->Open(p,a)
  155. #define IDirectMusicSynth8_Close(p) (p)->lpVtbl->Close(p)
  156. #define IDirectMusicSynth8_SetNumChannelGroups(p,a) (p)->lpVtbl->SetNumChannelGroups(p,a)
  157. #define IDirectMusicSynth8_Download(p,a,b,c) (p)->lpVtbl->Download(p,a,b,c)
  158. #define IDirectMusicSynth8_Unload(p,a,b,c) (p)->lpVtbl->Unload(p,a,b,c)
  159. #define IDirectMusicSynth8_PlayBuffer(p,a,b,c) (p)->lpVtbl->PlayBuffer(p,a,b,c)
  160. #define IDirectMusicSynth8_GetRunningStats(p,a) (p)->lpVtbl->GetRunningStats(p,a)
  161. #define IDirectMusicSynth8_GetPortCaps(p,a) (p)->lpVtbl->GetPortCaps(p,a)
  162. #define IDirectMusicSynth8_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a)
  163. #define IDirectMusicSynth8_GetLatencyClock(p,a) (p)->lpVtbl->GetLatencyClock(p,a)
  164. #define IDirectMusicSynth8_Activate(p,a) (p)->lpVtbl->Activate(p,a)
  165. #define IDirectMusicSynth8_SetSynthSink(p,a) (p)->lpVtbl->SetSynthSink(p,a)
  166. #define IDirectMusicSynth8_Render(p,a,b,c) (p)->lpVtbl->Render(p,a,b,c)
  167. #define IDirectMusicSynth8_SetChannelPriority(p,a,b,c) (p)->lpVtbl->SetChannelPriority(p,a,b,c)
  168. #define IDirectMusicSynth8_GetChannelPriority(p,a,b,c) (p)->lpVtbl->GetChannelPriority(p,a,b,c)
  169. #define IDirectMusicSynth8_GetFormat(p,a,b) (p)->lpVtbl->GetFormat(p,a,b)
  170. #define IDirectMusicSynth8_GetAppend(p,a) (p)->lpVtbl->GetAppend(p,a)
  171. /*** IDirectMusicSynth8 methods ***/
  172. #define IDirectMusicSynth8_PlayVoice(p,a,b,c,d,e,f,g,h,i,j) (p)->lpVtbl->PlayVoice(p,a,b,c,d,e,f,g,h,i,j)
  173. #define IDirectMusicSynth8_StopVoice(p,a,b) (p)->lpVtbl->StopVoice(p,a,b)
  174. #define IDirectMusicSynth8_GetVoiceState(p,a,b,c) (p)->lpVtbl->GetVoiceState(p,a,b,c)
  175. #define IDirectMusicSynth8_Refresh(p,a,b) (p)->lpVtbl->Refresh(p,a,b)
  176. #define IDirectMusicSynth8_AssignChannelToBuses(p,a,b,c,d) (p)->lpVtbl->AssignChannelToBuses(p,a,b,c,d)
  177. #endif
  178. /*****************************************************************************
  179. * IDirectMusicSynthSink interface
  180. */
  181. #define INTERFACE IDirectMusicSynthSink
  182. DECLARE_INTERFACE_(IDirectMusicSynthSink,IUnknown)
  183. {
  184. /*** IUnknown methods ***/
  185. STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
  186. STDMETHOD_(ULONG,AddRef)(THIS) PURE;
  187. STDMETHOD_(ULONG,Release)(THIS) PURE;
  188. /*** IDirectMusicSynthSink methods ***/
  189. STDMETHOD(Init)(THIS_ IDirectMusicSynth *pSynth) PURE;
  190. STDMETHOD(SetMasterClock)(THIS_ IReferenceClock *pClock) PURE;
  191. STDMETHOD(GetLatencyClock)(THIS_ IReferenceClock **ppClock) PURE;
  192. STDMETHOD(Activate)(THIS_ BOOL fEnable) PURE;
  193. STDMETHOD(SampleToRefTime)(THIS_ LONGLONG llSampleTime, REFERENCE_TIME *prfTime) PURE;
  194. STDMETHOD(RefTimeToSample)(THIS_ REFERENCE_TIME rfTime, LONGLONG *pllSampleTime) PURE;
  195. STDMETHOD(SetDirectSound)(THIS_ LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer) PURE;
  196. STDMETHOD(GetDesiredBufferSize)(THIS_ LPDWORD pdwBufferSizeInSamples) PURE;
  197. };
  198. #undef INTERFACE
  199. #if !defined(__cplusplus) || defined(CINTERFACE)
  200. /*** IUnknown methods ***/
  201. #define IDirectMusicSynthSink_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  202. #define IDirectMusicSynthSink_AddRef(p) (p)->lpVtbl->AddRef(p)
  203. #define IDirectMusicSynthSink_Release(p) (p)->lpVtbl->Release(p)
  204. /*** IDirectMusicSynth methods ***/
  205. #define IDirectMusicSynthSink_Init(p,a) (p)->lpVtbl->Init(p,a)
  206. #define IDirectMusicSynthSink_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a)
  207. #define IDirectMusicSynthSink_GetLatencyClock(p,a) (p)->lpVtbl->GetLatencyClock(p,a)
  208. #define IDirectMusicSynthSink_Activate(p,a) (p)->lpVtbl->Activate(p,a)
  209. #define IDirectMusicSynthSink_SampleToRefTime(p,a,b) (p)->lpVtbl->SampleToRefTime(p,a,b)
  210. #define IDirectMusicSynthSink_RefTimeToSample(p,a,b) (p)->lpVtbl->RefTimeToSample(p,a,b)
  211. #define IDirectMusicSynthSink_SetDirectSound(p,a,b) (p)->lpVtbl->SetDirectSound(p,a,b)
  212. #define IDirectMusicSynthSink_GetDesiredBufferSize(p,a) (p)->lpVtbl->GetDesiredBufferSize(p,a)
  213. #endif
  214. #endif /* __WINE_DMUSIC_SOFTWARESYNTH_H */