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
|
---|
7 | * modify it under the terms of the GNU Lesser General Public
|
---|
8 | * License as published by the Free Software Foundation; either
|
---|
9 | * version 2.1 of the License, or (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 GNU
|
---|
14 | * Lesser General Public License for more details.
|
---|
15 | *
|
---|
16 | * You should have received a copy of the GNU Lesser General Public
|
---|
17 | * License along with this program; if not, write to the Free Software
|
---|
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
19 | */
|
---|
20 |
|
---|
21 | /*
|
---|
22 | * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
23 | * other than GPL or LGPL is available it will apply instead, Sun elects to use only
|
---|
24 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
25 | * a choice of LGPL license versions is made available with the language indicating
|
---|
26 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
27 | * of the LGPL is applied is otherwise unspecified.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef __WINE_DMUSIC_SOFTWARESYNTH_H
|
---|
31 | #define __WINE_DMUSIC_SOFTWARESYNTH_H
|
---|
32 |
|
---|
33 | #include <dmusicc.h>
|
---|
34 |
|
---|
35 | /*****************************************************************************
|
---|
36 | * Registry path
|
---|
37 | */
|
---|
38 | #define REGSTR_PATH_SOFTWARESYNTHS "Software\\Microsoft\\DirectMusic\\SoftwareSynths"
|
---|
39 |
|
---|
40 |
|
---|
41 | /*****************************************************************************
|
---|
42 | * Predeclare the interfaces
|
---|
43 | */
|
---|
44 | /* IIDs */
|
---|
45 | DEFINE_GUID(IID_IDirectMusicSynth, 0x09823661,0x5c85,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6);
|
---|
46 | DEFINE_GUID(IID_IDirectMusicSynth8, 0x53cab625,0x2711,0x4c9f,0x9d,0xe7,0x1b,0x7f,0x92,0x5f,0x6f,0xc8);
|
---|
47 | DEFINE_GUID(IID_IDirectMusicSynthSink, 0x09823663,0x5c85,0x11d2,0xaf,0xa6,0x00,0xaa,0x00,0x24,0xd8,0xb6);
|
---|
48 |
|
---|
49 | /* typedef definitions */
|
---|
50 | typedef struct IDirectMusicSynth *LPDIRECTMUSICSYNTH;
|
---|
51 | typedef struct IDirectMusicSynth8 *LPDIRECTMUSICSYNTH8;
|
---|
52 | typedef struct IDirectMusicSynthSink *LPDIRECTMUSICSYNTHSINK;
|
---|
53 |
|
---|
54 | /* GUIDs - property set */
|
---|
55 | DEFINE_GUID(GUID_DMUS_PROP_SetSynthSink, 0x0a3a5ba5,0x37b6,0x11d2,0xb9,0xf9,0x00,0x00,0xf8,0x75,0xac,0x12);
|
---|
56 | DEFINE_GUID(GUID_DMUS_PROP_SinkUsesDSound, 0xbe208857,0x8952,0x11d2,0xba,0x1c,0x00,0x00,0xf8,0x75,0xac,0x12);
|
---|
57 |
|
---|
58 |
|
---|
59 | /*****************************************************************************
|
---|
60 | * Flags
|
---|
61 | */
|
---|
62 | #define REFRESH_F_LASTBUFFER 0x1
|
---|
63 |
|
---|
64 |
|
---|
65 | /*****************************************************************************
|
---|
66 | * Structures
|
---|
67 | */
|
---|
68 | #ifndef _DMUS_VOICE_STATE_DEFINED
|
---|
69 | #define _DMUS_VOICE_STATE_DEFINED
|
---|
70 |
|
---|
71 | /* typedef definition */
|
---|
72 | typedef struct _DMUS_VOICE_STATE DMUS_VOICE_STATE, *LPDMUS_VOICE_STATE;
|
---|
73 |
|
---|
74 | /* actual structure */
|
---|
75 | struct _DMUS_VOICE_STATE {
|
---|
76 | BOOL bExists;
|
---|
77 | SAMPLE_POSITION spPosition;
|
---|
78 | };
|
---|
79 | #endif /* _DMUS_VOICE_STATE_DEFINED */
|
---|
80 |
|
---|
81 |
|
---|
82 | /*****************************************************************************
|
---|
83 | * IDirectMusicSynth interface
|
---|
84 | */
|
---|
85 | #define INTERFACE IDirectMusicSynth
|
---|
86 | DECLARE_INTERFACE_(IDirectMusicSynth,IUnknown)
|
---|
87 | {
|
---|
88 | /*** IUnknown methods ***/
|
---|
89 | STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
|
---|
90 | STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
---|
91 | STDMETHOD_(ULONG,Release)(THIS) PURE;
|
---|
92 | /*** IDirectMusicSynth methods ***/
|
---|
93 | STDMETHOD(Open)(THIS_ LPDMUS_PORTPARAMS pPortParams) PURE;
|
---|
94 | STDMETHOD(Close)(THIS) PURE;
|
---|
95 | STDMETHOD(SetNumChannelGroups)(THIS_ DWORD dwGroups) PURE;
|
---|
96 | STDMETHOD(Download)(THIS_ LPHANDLE phDownload, LPVOID pvData, LPBOOL pbFree) PURE;
|
---|
97 | STDMETHOD(Unload)(THIS_ HANDLE hDownload, HRESULT (CALLBACK* lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData) PURE;
|
---|
98 | STDMETHOD(PlayBuffer)(THIS_ REFERENCE_TIME rt, LPBYTE pbBuffer, DWORD cbBuffer) PURE;
|
---|
99 | STDMETHOD(GetRunningStats)(THIS_ LPDMUS_SYNTHSTATS pStats) PURE;
|
---|
100 | STDMETHOD(GetPortCaps)(THIS_ LPDMUS_PORTCAPS pCaps) PURE;
|
---|
101 | STDMETHOD(SetMasterClock)(THIS_ IReferenceClock *pClock) PURE;
|
---|
102 | STDMETHOD(GetLatencyClock)(THIS_ IReferenceClock **ppClock) PURE;
|
---|
103 | STDMETHOD(Activate)(THIS_ BOOL fEnable) PURE;
|
---|
104 | STDMETHOD(SetSynthSink)(THIS_ struct IDirectMusicSynthSink *pSynthSink) PURE;
|
---|
105 | STDMETHOD(Render)(THIS_ short *pBuffer, DWORD dwLength, LONGLONG llPosition) PURE;
|
---|
106 | STDMETHOD(SetChannelPriority)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority) PURE;
|
---|
107 | STDMETHOD(GetChannelPriority)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority) PURE;
|
---|
108 | STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSiz) PURE;
|
---|
109 | STDMETHOD(GetAppend)(THIS_ DWORD *pdwAppend) PURE;
|
---|
110 | };
|
---|
111 | #undef INTERFACE
|
---|
112 |
|
---|
113 | #if !defined(__cplusplus) || defined(CINTERFACE)
|
---|
114 | /*** IUnknown methods ***/
|
---|
115 | #define IDirectMusicSynth_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
---|
116 | #define IDirectMusicSynth_AddRef(p) (p)->lpVtbl->AddRef(p)
|
---|
117 | #define IDirectMusicSynth_Release(p) (p)->lpVtbl->Release(p)
|
---|
118 | /*** IDirectMusicSynth methods ***/
|
---|
119 | #define IDirectMusicSynth_Open(p,a) (p)->lpVtbl->Open(p,a)
|
---|
120 | #define IDirectMusicSynth_Close(p) (p)->lpVtbl->Close(p)
|
---|
121 | #define IDirectMusicSynth_SetNumChannelGroups(p,a) (p)->lpVtbl->SetNumChannelGroups(p,a)
|
---|
122 | #define IDirectMusicSynth_Download(p,a,b,c) (p)->lpVtbl->Download(p,a,b,c)
|
---|
123 | #define IDirectMusicSynth_Unload(p,a,b,c) (p)->lpVtbl->Unload(p,a,b,c)
|
---|
124 | #define IDirectMusicSynth_PlayBuffer(p,a,b,c) (p)->lpVtbl->PlayBuffer(p,a,b,c)
|
---|
125 | #define IDirectMusicSynth_GetRunningStats(p,a) (p)->lpVtbl->GetRunningStats(p,a)
|
---|
126 | #define IDirectMusicSynth_GetPortCaps(p,a) (p)->lpVtbl->GetPortCaps(p,a)
|
---|
127 | #define IDirectMusicSynth_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a)
|
---|
128 | #define IDirectMusicSynth_GetLatencyClock(p,a) (p)->lpVtbl->GetLatencyClock(p,a)
|
---|
129 | #define IDirectMusicSynth_Activate(p,a) (p)->lpVtbl->Activate(p,a)
|
---|
130 | #define IDirectMusicSynth_SetSynthSink(p,a) (p)->lpVtbl->SetSynthSink(p,a)
|
---|
131 | #define IDirectMusicSynth_Render(p,a,b,c) (p)->lpVtbl->Render(p,a,b,c)
|
---|
132 | #define IDirectMusicSynth_SetChannelPriority(p,a,b,c) (p)->lpVtbl->SetChannelPriority(p,a,b,c)
|
---|
133 | #define IDirectMusicSynth_GetChannelPriority(p,a,b,c) (p)->lpVtbl->GetChannelPriority(p,a,b,c)
|
---|
134 | #define IDirectMusicSynth_GetFormat(p,a,b) (p)->lpVtbl->GetFormat(p,a,b)
|
---|
135 | #define IDirectMusicSynth_GetAppend(p,a) (p)->lpVtbl->GetAppend(p,a)
|
---|
136 | #endif
|
---|
137 |
|
---|
138 |
|
---|
139 | /*****************************************************************************
|
---|
140 | * IDirectMusicSynth8 interface
|
---|
141 | */
|
---|
142 | #define INTERFACE IDirectMusicSynth8
|
---|
143 | DECLARE_INTERFACE_(IDirectMusicSynth8,IDirectMusicSynth)
|
---|
144 | {
|
---|
145 | /*** IUnknown methods ***/
|
---|
146 | STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
|
---|
147 | STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
---|
148 | STDMETHOD_(ULONG,Release)(THIS) PURE;
|
---|
149 | /*** IDirectMusicSynth methods ***/
|
---|
150 | STDMETHOD(Open)(THIS_ LPDMUS_PORTPARAMS pPortParams) PURE;
|
---|
151 | STDMETHOD(Close)(THIS) PURE;
|
---|
152 | STDMETHOD(SetNumChannelGroups)(THIS_ DWORD dwGroups) PURE;
|
---|
153 | STDMETHOD(Download)(THIS_ LPHANDLE phDownload, LPVOID pvData, LPBOOL pbFree) PURE;
|
---|
154 | STDMETHOD(Unload)(THIS_ HANDLE hDownload, HRESULT (CALLBACK* lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData) PURE;
|
---|
155 | STDMETHOD(PlayBuffer)(THIS_ REFERENCE_TIME rt, LPBYTE pbBuffer, DWORD cbBuffer) PURE;
|
---|
156 | STDMETHOD(GetRunningStats)(THIS_ LPDMUS_SYNTHSTATS pStats) PURE;
|
---|
157 | STDMETHOD(GetPortCaps)(THIS_ LPDMUS_PORTCAPS pCaps) PURE;
|
---|
158 | STDMETHOD(SetMasterClock)(THIS_ IReferenceClock *pClock) PURE;
|
---|
159 | STDMETHOD(GetLatencyClock)(THIS_ IReferenceClock **ppClock) PURE;
|
---|
160 | STDMETHOD(Activate)(THIS_ BOOL fEnable) PURE;
|
---|
161 | STDMETHOD(SetSynthSink)(THIS_ struct IDirectMusicSynthSink *pSynthSink) PURE;
|
---|
162 | STDMETHOD(Render)(THIS_ short *pBuffer, DWORD dwLength, LONGLONG llPosition) PURE;
|
---|
163 | STDMETHOD(SetChannelPriority)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority) PURE;
|
---|
164 | STDMETHOD(GetChannelPriority)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority) PURE;
|
---|
165 | STDMETHOD(GetFormat)(THIS_ LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSiz) PURE;
|
---|
166 | STDMETHOD(GetAppend)(THIS_ DWORD *pdwAppend) PURE;
|
---|
167 | /*** IDirectMusicSynth8 methods ***/
|
---|
168 | 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;
|
---|
169 | STDMETHOD(StopVoice)(THIS_ REFERENCE_TIME rt, DWORD dwVoiceId) PURE;
|
---|
170 | STDMETHOD(GetVoiceState)(THIS_ DWORD dwVoice[], DWORD cbVoice, DMUS_VOICE_STATE dwVoiceState[]) PURE;
|
---|
171 | STDMETHOD(Refresh)(THIS_ DWORD dwDownloadID, DWORD dwFlags) PURE;
|
---|
172 | STDMETHOD(AssignChannelToBuses)(THIS_ DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwBuses, DWORD cBuses) PURE;
|
---|
173 | };
|
---|
174 | #undef INTERFACE
|
---|
175 |
|
---|
176 | #if !defined(__cplusplus) || defined(CINTERFACE)
|
---|
177 | /*** IUnknown methods ***/
|
---|
178 | #define IDirectMusicSynth8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
---|
179 | #define IDirectMusicSynth8_AddRef(p) (p)->lpVtbl->AddRef(p)
|
---|
180 | #define IDirectMusicSynth8_Release(p) (p)->lpVtbl->Release(p)
|
---|
181 | /*** IDirectMusicSynth methods ***/
|
---|
182 | #define IDirectMusicSynth8_Open(p,a) (p)->lpVtbl->Open(p,a)
|
---|
183 | #define IDirectMusicSynth8_Close(p) (p)->lpVtbl->Close(p)
|
---|
184 | #define IDirectMusicSynth8_SetNumChannelGroups(p,a) (p)->lpVtbl->SetNumChannelGroups(p,a)
|
---|
185 | #define IDirectMusicSynth8_Download(p,a,b,c) (p)->lpVtbl->Download(p,a,b,c)
|
---|
186 | #define IDirectMusicSynth8_Unload(p,a,b,c) (p)->lpVtbl->Unload(p,a,b,c)
|
---|
187 | #define IDirectMusicSynth8_PlayBuffer(p,a,b,c) (p)->lpVtbl->PlayBuffer(p,a,b,c)
|
---|
188 | #define IDirectMusicSynth8_GetRunningStats(p,a) (p)->lpVtbl->GetRunningStats(p,a)
|
---|
189 | #define IDirectMusicSynth8_GetPortCaps(p,a) (p)->lpVtbl->GetPortCaps(p,a)
|
---|
190 | #define IDirectMusicSynth8_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a)
|
---|
191 | #define IDirectMusicSynth8_GetLatencyClock(p,a) (p)->lpVtbl->GetLatencyClock(p,a)
|
---|
192 | #define IDirectMusicSynth8_Activate(p,a) (p)->lpVtbl->Activate(p,a)
|
---|
193 | #define IDirectMusicSynth8_SetSynthSink(p,a) (p)->lpVtbl->SetSynthSink(p,a)
|
---|
194 | #define IDirectMusicSynth8_Render(p,a,b,c) (p)->lpVtbl->Render(p,a,b,c)
|
---|
195 | #define IDirectMusicSynth8_SetChannelPriority(p,a,b,c) (p)->lpVtbl->SetChannelPriority(p,a,b,c)
|
---|
196 | #define IDirectMusicSynth8_GetChannelPriority(p,a,b,c) (p)->lpVtbl->GetChannelPriority(p,a,b,c)
|
---|
197 | #define IDirectMusicSynth8_GetFormat(p,a,b) (p)->lpVtbl->GetFormat(p,a,b)
|
---|
198 | #define IDirectMusicSynth8_GetAppend(p,a) (p)->lpVtbl->GetAppend(p,a)
|
---|
199 | /*** IDirectMusicSynth8 methods ***/
|
---|
200 | #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)
|
---|
201 | #define IDirectMusicSynth8_StopVoice(p,a,b) (p)->lpVtbl->StopVoice(p,a,b)
|
---|
202 | #define IDirectMusicSynth8_GetVoiceState(p,a,b,c) (p)->lpVtbl->GetVoiceState(p,a,b,c)
|
---|
203 | #define IDirectMusicSynth8_Refresh(p,a,b) (p)->lpVtbl->Refresh(p,a,b)
|
---|
204 | #define IDirectMusicSynth8_AssignChannelToBuses(p,a,b,c,d) (p)->lpVtbl->AssignChannelToBuses(p,a,b,c,d)
|
---|
205 | #endif
|
---|
206 |
|
---|
207 |
|
---|
208 | /*****************************************************************************
|
---|
209 | * IDirectMusicSynthSink interface
|
---|
210 | */
|
---|
211 | #define INTERFACE IDirectMusicSynthSink
|
---|
212 | DECLARE_INTERFACE_(IDirectMusicSynthSink,IUnknown)
|
---|
213 | {
|
---|
214 | /*** IUnknown methods ***/
|
---|
215 | STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
|
---|
216 | STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
---|
217 | STDMETHOD_(ULONG,Release)(THIS) PURE;
|
---|
218 | /*** IDirectMusicSynthSink methods ***/
|
---|
219 | STDMETHOD(Init)(THIS_ IDirectMusicSynth *pSynth) PURE;
|
---|
220 | STDMETHOD(SetMasterClock)(THIS_ IReferenceClock *pClock) PURE;
|
---|
221 | STDMETHOD(GetLatencyClock)(THIS_ IReferenceClock **ppClock) PURE;
|
---|
222 | STDMETHOD(Activate)(THIS_ BOOL fEnable) PURE;
|
---|
223 | STDMETHOD(SampleToRefTime)(THIS_ LONGLONG llSampleTime, REFERENCE_TIME *prfTime) PURE;
|
---|
224 | STDMETHOD(RefTimeToSample)(THIS_ REFERENCE_TIME rfTime, LONGLONG *pllSampleTime) PURE;
|
---|
225 | STDMETHOD(SetDirectSound)(THIS_ LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer) PURE;
|
---|
226 | STDMETHOD(GetDesiredBufferSize)(THIS_ LPDWORD pdwBufferSizeInSamples) PURE;
|
---|
227 | };
|
---|
228 | #undef INTERFACE
|
---|
229 |
|
---|
230 | #if !defined(__cplusplus) || defined(CINTERFACE)
|
---|
231 | /*** IUnknown methods ***/
|
---|
232 | #define IDirectMusicSynthSink_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
---|
233 | #define IDirectMusicSynthSink_AddRef(p) (p)->lpVtbl->AddRef(p)
|
---|
234 | #define IDirectMusicSynthSink_Release(p) (p)->lpVtbl->Release(p)
|
---|
235 | /*** IDirectMusicSynth methods ***/
|
---|
236 | #define IDirectMusicSynthSink_Init(p,a) (p)->lpVtbl->Init(p,a)
|
---|
237 | #define IDirectMusicSynthSink_SetMasterClock(p,a) (p)->lpVtbl->SetMasterClock(p,a)
|
---|
238 | #define IDirectMusicSynthSink_GetLatencyClock(p,a) (p)->lpVtbl->GetLatencyClock(p,a)
|
---|
239 | #define IDirectMusicSynthSink_Activate(p,a) (p)->lpVtbl->Activate(p,a)
|
---|
240 | #define IDirectMusicSynthSink_SampleToRefTime(p,a,b) (p)->lpVtbl->SampleToRefTime(p,a,b)
|
---|
241 | #define IDirectMusicSynthSink_RefTimeToSample(p,a,b) (p)->lpVtbl->RefTimeToSample(p,a,b)
|
---|
242 | #define IDirectMusicSynthSink_SetDirectSound(p,a,b) (p)->lpVtbl->SetDirectSound(p,a,b)
|
---|
243 | #define IDirectMusicSynthSink_GetDesiredBufferSize(p,a) (p)->lpVtbl->GetDesiredBufferSize(p,a)
|
---|
244 | #endif
|
---|
245 |
|
---|
246 | #endif /* __WINE_DMUSIC_SOFTWARESYNTH_H */
|
---|