Release 20030408.
[wine/gsoc-2012-control.git] / dlls / dmusic / dmusic_synth.c
blobf1a4dbbae501392af1879fa30c580dc1b8b0b0b6
1 /* IDirectMusicSynth Implementation
2 * IDirectMusicSynth8 Implementation
3 * IDirectMusicSynthSink Implementation
5 * Copyright (C) 2003 Rok Mandeljc
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Library General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #include "windef.h"
23 #include "winbase.h"
24 #include "winuser.h"
25 #include "wingdi.h"
26 #include "wine/debug.h"
28 #include "dmusic_private.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
32 /* IDirectMusicSynth IUnknown parts follow: */
33 HRESULT WINAPI IDirectMusicSynthImpl_QueryInterface (LPDIRECTMUSICSYNTH iface, REFIID riid, LPVOID *ppobj)
35 ICOM_THIS(IDirectMusicSynthImpl,iface);
37 if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicSynth))
39 IDirectMusicSynthImpl_AddRef(iface);
40 *ppobj = This;
41 return DS_OK;
43 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
44 return E_NOINTERFACE;
47 ULONG WINAPI IDirectMusicSynthImpl_AddRef (LPDIRECTMUSICSYNTH iface)
49 ICOM_THIS(IDirectMusicSynthImpl,iface);
50 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
51 return ++(This->ref);
54 ULONG WINAPI IDirectMusicSynthImpl_Release (LPDIRECTMUSICSYNTH iface)
56 ICOM_THIS(IDirectMusicSynthImpl,iface);
57 ULONG ref = --This->ref;
58 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
59 if (ref == 0)
61 HeapFree(GetProcessHeap(), 0, This);
63 return ref;
66 /* IDirectMusicSynth Interface follow: */
67 HRESULT WINAPI IDirectMusicSynthImpl_Open (LPDIRECTMUSICSYNTH iface, LPDMUS_PORTPARAMS pPortParams)
69 FIXME("stub\n");
70 return DS_OK;
73 HRESULT WINAPI IDirectMusicSynthImpl_Close (LPDIRECTMUSICSYNTH iface)
75 FIXME("stub\n");
76 return DS_OK;
79 HRESULT WINAPI IDirectMusicSynthImpl_SetNumChannelGroups (LPDIRECTMUSICSYNTH iface, DWORD dwGroups)
81 FIXME("stub\n");
82 return DS_OK;
85 HRESULT WINAPI IDirectMusicSynthImpl_Download (LPDIRECTMUSICSYNTH iface, LPHANDLE phDownload, LPVOID pvData, LPBOOL pbFree)
87 FIXME("stub\n");
88 return DS_OK;
91 HRESULT WINAPI IDirectMusicSynthImpl_Unload (LPDIRECTMUSICSYNTH iface, HANDLE hDownload, HRESULT (CALLBACK* lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData)
93 FIXME("stub\n");
94 return DS_OK;
97 HRESULT WINAPI IDirectMusicSynthImpl_PlayBuffer (LPDIRECTMUSICSYNTH iface, REFERENCE_TIME rt, LPBYTE pbBuffer, DWORD cbBuffer)
99 FIXME("stub\n");
100 return DS_OK;
103 HRESULT WINAPI IDirectMusicSynthImpl_GetRunningStats (LPDIRECTMUSICSYNTH iface, LPDMUS_SYNTHSTATS pStats)
105 FIXME("stub\n");
106 return DS_OK;
109 HRESULT WINAPI IDirectMusicSynthImpl_GetPortCaps (LPDIRECTMUSICSYNTH iface, LPDMUS_PORTCAPS pCaps)
111 FIXME("stub\n");
112 return DS_OK;
115 HRESULT WINAPI IDirectMusicSynthImpl_SetMasterClock (LPDIRECTMUSICSYNTH iface, IReferenceClock* pClock)
117 FIXME("stub\n");
118 return DS_OK;
121 HRESULT WINAPI IDirectMusicSynthImpl_GetLatencyClock (LPDIRECTMUSICSYNTH iface, IReferenceClock** ppClock)
123 FIXME("stub\n");
124 return DS_OK;
127 HRESULT WINAPI IDirectMusicSynthImpl_Activate (LPDIRECTMUSICSYNTH iface, BOOL fEnable)
129 FIXME("stub\n");
130 return DS_OK;
133 HRESULT WINAPI IDirectMusicSynthImpl_SetSynthSink (LPDIRECTMUSICSYNTH iface, IDirectMusicSynthSink* pSynthSink)
135 FIXME("stub\n");
136 return DS_OK;
139 HRESULT WINAPI IDirectMusicSynthImpl_Render (LPDIRECTMUSICSYNTH iface, short* pBuffer, DWORD dwLength, LONGLONG llPosition)
141 FIXME("stub\n");
142 return DS_OK;
145 HRESULT WINAPI IDirectMusicSynthImpl_SetChannelPriority (LPDIRECTMUSICSYNTH iface, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority)
147 FIXME("stub\n");
148 return DS_OK;
151 HRESULT WINAPI IDirectMusicSynthImpl_GetChannelPriority (LPDIRECTMUSICSYNTH iface, DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority)
153 FIXME("stub\n");
154 return DS_OK;
157 HRESULT WINAPI IDirectMusicSynthImpl_GetFormat (LPDIRECTMUSICSYNTH iface, LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSiz)
159 FIXME("stub\n");
160 return DS_OK;
163 HRESULT WINAPI IDirectMusicSynthImpl_GetAppend (LPDIRECTMUSICSYNTH iface, DWORD* pdwAppend)
165 FIXME("stub\n");
166 return DS_OK;
169 ICOM_VTABLE(IDirectMusicSynth) DirectMusicSynth_Vtbl =
171 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
172 IDirectMusicSynthImpl_QueryInterface,
173 IDirectMusicSynthImpl_AddRef,
174 IDirectMusicSynthImpl_Release,
175 IDirectMusicSynthImpl_Open,
176 IDirectMusicSynthImpl_Close,
177 IDirectMusicSynthImpl_SetNumChannelGroups,
178 IDirectMusicSynthImpl_Download,
179 IDirectMusicSynthImpl_Unload,
180 IDirectMusicSynthImpl_PlayBuffer,
181 IDirectMusicSynthImpl_GetRunningStats,
182 IDirectMusicSynthImpl_GetPortCaps,
183 IDirectMusicSynthImpl_SetMasterClock,
184 IDirectMusicSynthImpl_GetLatencyClock,
185 IDirectMusicSynthImpl_Activate,
186 IDirectMusicSynthImpl_SetSynthSink,
187 IDirectMusicSynthImpl_Render,
188 IDirectMusicSynthImpl_SetChannelPriority,
189 IDirectMusicSynthImpl_GetChannelPriority,
190 IDirectMusicSynthImpl_GetFormat,
191 IDirectMusicSynthImpl_GetAppend
195 /* IDirectMusicSynth8 IUnknown parts follow: */
196 HRESULT WINAPI IDirectMusicSynth8Impl_QueryInterface (LPDIRECTMUSICSYNTH8 iface, REFIID riid, LPVOID *ppobj)
198 ICOM_THIS(IDirectMusicSynth8Impl,iface);
200 if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicSynth8))
202 IDirectMusicSynth8Impl_AddRef(iface);
203 *ppobj = This;
204 return DS_OK;
206 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
207 return E_NOINTERFACE;
210 ULONG WINAPI IDirectMusicSynth8Impl_AddRef (LPDIRECTMUSICSYNTH8 iface)
212 ICOM_THIS(IDirectMusicSynth8Impl,iface);
213 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
214 return ++(This->ref);
217 ULONG WINAPI IDirectMusicSynth8Impl_Release (LPDIRECTMUSICSYNTH8 iface)
219 ICOM_THIS(IDirectMusicSynth8Impl,iface);
220 ULONG ref = --This->ref;
221 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
222 if (ref == 0)
224 HeapFree(GetProcessHeap(), 0, This);
226 return ref;
229 /* IDirectMusicSynth Interface parts follow: */
230 HRESULT WINAPI IDirectMusicSynth8Impl_Open (LPDIRECTMUSICSYNTH8 iface, LPDMUS_PORTPARAMS pPortParams)
232 FIXME("stub\n");
233 return DS_OK;
236 HRESULT WINAPI IDirectMusicSynth8Impl_Close (LPDIRECTMUSICSYNTH8 iface)
238 FIXME("stub\n");
239 return DS_OK;
242 HRESULT WINAPI IDirectMusicSynth8Impl_SetNumChannelGroups (LPDIRECTMUSICSYNTH8 iface, DWORD dwGroups)
244 FIXME("stub\n");
245 return DS_OK;
248 HRESULT WINAPI IDirectMusicSynth8Impl_Download (LPDIRECTMUSICSYNTH8 iface, LPHANDLE phDownload, LPVOID pvData, LPBOOL pbFree)
250 FIXME("stub\n");
251 return DS_OK;
254 HRESULT WINAPI IDirectMusicSynth8Impl_Unload (LPDIRECTMUSICSYNTH8 iface, HANDLE hDownload, HRESULT (CALLBACK* lpFreeHandle)(HANDLE,HANDLE), HANDLE hUserData)
256 FIXME("stub\n");
257 return DS_OK;
260 HRESULT WINAPI IDirectMusicSynth8Impl_PlayBuffer (LPDIRECTMUSICSYNTH8 iface, REFERENCE_TIME rt, LPBYTE pbBuffer, DWORD cbBuffer)
262 FIXME("stub\n");
263 return DS_OK;
266 HRESULT WINAPI IDirectMusicSynth8Impl_GetRunningStats (LPDIRECTMUSICSYNTH8 iface, LPDMUS_SYNTHSTATS pStats)
268 FIXME("stub\n");
269 return DS_OK;
272 HRESULT WINAPI IDirectMusicSynth8Impl_GetPortCaps (LPDIRECTMUSICSYNTH8 iface, LPDMUS_PORTCAPS pCaps)
274 FIXME("stub\n");
275 return DS_OK;
278 HRESULT WINAPI IDirectMusicSynth8Impl_SetMasterClock (LPDIRECTMUSICSYNTH8 iface, IReferenceClock* pClock)
280 FIXME("stub\n");
281 return DS_OK;
284 HRESULT WINAPI IDirectMusicSynth8Impl_GetLatencyClock (LPDIRECTMUSICSYNTH8 iface, IReferenceClock** ppClock)
286 FIXME("stub\n");
287 return DS_OK;
290 HRESULT WINAPI IDirectMusicSynth8Impl_Activate (LPDIRECTMUSICSYNTH8 iface, BOOL fEnable)
292 FIXME("stub\n");
293 return DS_OK;
296 HRESULT WINAPI IDirectMusicSynth8Impl_SetSynthSink (LPDIRECTMUSICSYNTH8 iface, IDirectMusicSynthSink* pSynthSink)
298 FIXME("stub\n");
299 return DS_OK;
302 HRESULT WINAPI IDirectMusicSynth8Impl_Render (LPDIRECTMUSICSYNTH8 iface, short* pBuffer, DWORD dwLength, LONGLONG llPosition)
304 FIXME("stub\n");
305 return DS_OK;
308 HRESULT WINAPI IDirectMusicSynth8Impl_SetChannelPriority (LPDIRECTMUSICSYNTH8 iface, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority)
310 FIXME("stub\n");
311 return DS_OK;
314 HRESULT WINAPI IDirectMusicSynth8Impl_GetChannelPriority (LPDIRECTMUSICSYNTH8 iface, DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority)
316 FIXME("stub\n");
317 return DS_OK;
320 HRESULT WINAPI IDirectMusicSynth8Impl_GetFormat (LPDIRECTMUSICSYNTH8 iface, LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSiz)
322 FIXME("stub\n");
323 return DS_OK;
326 HRESULT WINAPI IDirectMusicSynth8Impl_GetAppend (LPDIRECTMUSICSYNTH8 iface, DWORD* pdwAppend)
328 FIXME("stub\n");
329 return DS_OK;
332 /* IDirectMusicSynth8 Interface parts follow: */
333 HRESULT WINAPI IDirectMusicSynth8Impl_PlayVoice (LPDIRECTMUSICSYNTH8 iface, REFERENCE_TIME rt, DWORD dwVoiceId, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwDLId, long prPitch, long vrVolume, SAMPLE_TIME stVoiceStart, SAMPLE_TIME stLoopStart, SAMPLE_TIME stLoopEnd)
335 FIXME("stub\n");
336 return DS_OK;
339 HRESULT WINAPI IDirectMusicSynth8Impl_StopVoice (LPDIRECTMUSICSYNTH8 iface, REFERENCE_TIME rt, DWORD dwVoiceId)
341 FIXME("stub\n");
342 return DS_OK;
345 HRESULT WINAPI IDirectMusicSynth8Impl_GetVoiceState (LPDIRECTMUSICSYNTH8 iface, DWORD dwVoice[], DWORD cbVoice, DMUS_VOICE_STATE dwVoiceState[])
347 FIXME("stub\n");
348 return DS_OK;
351 HRESULT WINAPI IDirectMusicSynth8Impl_Refresh (LPDIRECTMUSICSYNTH8 iface, DWORD dwDownloadID, DWORD dwFlags)
353 FIXME("stub\n");
354 return DS_OK;
357 HRESULT WINAPI IDirectMusicSynth8Impl_AssignChannelToBuses (LPDIRECTMUSICSYNTH8 iface, DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwBuses, DWORD cBuses)
359 FIXME("stub\n");
360 return DS_OK;
363 ICOM_VTABLE(IDirectMusicSynth8) DirectMusicSynth8_Vtbl =
365 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
366 IDirectMusicSynth8Impl_QueryInterface,
367 IDirectMusicSynth8Impl_AddRef,
368 IDirectMusicSynth8Impl_Release,
369 IDirectMusicSynth8Impl_Open,
370 IDirectMusicSynth8Impl_Close,
371 IDirectMusicSynth8Impl_SetNumChannelGroups,
372 IDirectMusicSynth8Impl_Download,
373 IDirectMusicSynth8Impl_Unload,
374 IDirectMusicSynth8Impl_PlayBuffer,
375 IDirectMusicSynth8Impl_GetRunningStats,
376 IDirectMusicSynth8Impl_GetPortCaps,
377 IDirectMusicSynth8Impl_SetMasterClock,
378 IDirectMusicSynth8Impl_GetLatencyClock,
379 IDirectMusicSynth8Impl_Activate,
380 IDirectMusicSynth8Impl_SetSynthSink,
381 IDirectMusicSynth8Impl_Render,
382 IDirectMusicSynth8Impl_SetChannelPriority,
383 IDirectMusicSynth8Impl_GetChannelPriority,
384 IDirectMusicSynth8Impl_GetFormat,
385 IDirectMusicSynth8Impl_GetAppend,
386 IDirectMusicSynth8Impl_PlayVoice,
387 IDirectMusicSynth8Impl_StopVoice,
388 IDirectMusicSynth8Impl_GetVoiceState,
389 IDirectMusicSynth8Impl_Refresh,
390 IDirectMusicSynth8Impl_AssignChannelToBuses
394 /* IDirectMusicSynthSink IUnknown parts follow: */
395 HRESULT WINAPI IDirectMusicSynthSinkImpl_QueryInterface (LPDIRECTMUSICSYNTHSINK iface, REFIID riid, LPVOID *ppobj)
397 ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
399 if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicSynthSink))
401 IDirectMusicSynthSinkImpl_AddRef(iface);
402 *ppobj = This;
403 return DS_OK;
405 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
406 return E_NOINTERFACE;
409 ULONG WINAPI IDirectMusicSynthSinkImpl_AddRef (LPDIRECTMUSICSYNTHSINK iface)
411 ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
412 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
413 return ++(This->ref);
416 ULONG WINAPI IDirectMusicSynthSinkImpl_Release (LPDIRECTMUSICSYNTHSINK iface)
418 ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
419 ULONG ref = --This->ref;
420 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
421 if (ref == 0)
423 HeapFree(GetProcessHeap(), 0, This);
425 return ref;
428 /* IDirectMusicSynth Interface follow: */
429 HRESULT WINAPI IDirectMusicSinkSynthImpl_Init (LPDIRECTMUSICSYNTHSINK iface, IDirectMusicSynth* pSynth)
431 FIXME("stub\n");
432 return DS_OK;
435 HRESULT WINAPI IDirectMusicSinkSynthImpl_SetMasterClock (LPDIRECTMUSICSYNTHSINK iface, IReferenceClock* pClock)
437 FIXME("stub\n");
438 return DS_OK;
441 HRESULT WINAPI IDirectMusicSinkSynthImpl_GetLatencyClock (LPDIRECTMUSICSYNTHSINK iface, IReferenceClock** ppClock)
443 FIXME("stub\n");
444 return DS_OK;
447 HRESULT WINAPI IDirectMusicSinkSynthImpl_Activate (LPDIRECTMUSICSYNTHSINK iface, BOOL fEnable)
449 FIXME("stub\n");
450 return DS_OK;
453 HRESULT WINAPI IDirectMusicSinkSynthImpl_SampleToRefTime (LPDIRECTMUSICSYNTHSINK iface, LONGLONG llSampleTime, REFERENCE_TIME* prfTime)
455 FIXME("stub\n");
456 return DS_OK;
459 HRESULT WINAPI IDirectMusicSinkSynthImpl_RefTimeToSample (LPDIRECTMUSICSYNTHSINK iface, REFERENCE_TIME rfTime, LONGLONG* pllSampleTime)
461 FIXME("stub\n");
462 return DS_OK;
465 HRESULT WINAPI IDirectMusicSinkSynthImpl_SetDirectSound (LPDIRECTMUSICSYNTHSINK iface, LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer)
467 FIXME("stub\n");
468 return DS_OK;
471 HRESULT WINAPI IDirectMusicSinkSynthImpl_GetDesiredBufferSize (LPDIRECTMUSICSYNTHSINK iface, LPDWORD pdwBufferSizeInSamples)
473 FIXME("stub\n");
474 return DS_OK;
477 ICOM_VTABLE(IDirectMusicSynthSink) DirectMusicSynthSink_Vtbl =
479 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
480 IDirectMusicSynthSinkImpl_QueryInterface,
481 IDirectMusicSynthSinkImpl_AddRef,
482 IDirectMusicSynthSinkImpl_Release,
483 IDirectMusicSinkSynthImpl_Init,
484 IDirectMusicSinkSynthImpl_SetMasterClock,
485 IDirectMusicSinkSynthImpl_GetLatencyClock,
486 IDirectMusicSinkSynthImpl_Activate,
487 IDirectMusicSinkSynthImpl_SampleToRefTime,
488 IDirectMusicSinkSynthImpl_RefTimeToSample,
489 IDirectMusicSinkSynthImpl_SetDirectSound,
490 IDirectMusicSinkSynthImpl_GetDesiredBufferSize