Add a couple of missing spec files.
[wine.git] / dlls / dmsynth / synthsink.c
blobfad7de497d43486c7f4f8fcbb07b7f946025c552
1 /* IDirectMusicSynthSink Implementation
3 * Copyright (C) 2003 Rok Mandeljc
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU Library General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #include <stdarg.h>
22 #include "windef.h"
23 #include "winbase.h"
24 #include "winuser.h"
25 #include "wingdi.h"
26 #include "wine/debug.h"
28 #include "dmsynth_private.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(dmsynth);
32 /* IDirectMusicSynthSink IUnknown part: */
33 HRESULT WINAPI IDirectMusicSynthSinkImpl_QueryInterface (LPDIRECTMUSICSYNTHSINK iface, REFIID riid, LPVOID *ppobj)
35 ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
37 if (IsEqualIID (riid, &IID_IUnknown) ||
38 IsEqualIID (riid, &IID_IDirectMusicSynthSink)) {
39 IDirectMusicSynthSinkImpl_AddRef(iface);
40 *ppobj = This;
41 return S_OK;
44 WARN("(%p)->(%s,%p),not found\n", This, debugstr_guid(riid), ppobj);
45 return E_NOINTERFACE;
48 ULONG WINAPI IDirectMusicSynthSinkImpl_AddRef (LPDIRECTMUSICSYNTHSINK iface)
50 ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
51 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
52 return ++(This->ref);
55 ULONG WINAPI IDirectMusicSynthSinkImpl_Release (LPDIRECTMUSICSYNTHSINK iface)
57 ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
58 ULONG ref = --This->ref;
59 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
60 if (ref == 0) {
61 HeapFree(GetProcessHeap(), 0, This);
63 return ref;
66 /* IDirectMusicSynth IDirectMusicSynth part: */
67 HRESULT WINAPI IDirectMusicSynthSinkImpl_Init (LPDIRECTMUSICSYNTHSINK iface, IDirectMusicSynth* pSynth)
69 ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
71 FIXME("(%p, %p): stub\n", This, pSynth);
73 return S_OK;
76 HRESULT WINAPI IDirectMusicSynthSinkImpl_SetMasterClock (LPDIRECTMUSICSYNTHSINK iface, IReferenceClock* pClock)
78 ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
80 FIXME("(%p, %p): stub\n", This, pClock);
82 return S_OK;
85 HRESULT WINAPI IDirectMusicSynthSinkImpl_GetLatencyClock (LPDIRECTMUSICSYNTHSINK iface, IReferenceClock** ppClock)
87 ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
89 FIXME("(%p, %p): stub\n", This, ppClock);
91 return S_OK;
94 HRESULT WINAPI IDirectMusicSynthSinkImpl_Activate (LPDIRECTMUSICSYNTHSINK iface, BOOL fEnable)
96 ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
98 FIXME("(%p, %d): stub\n", This, fEnable);
100 return S_OK;
103 HRESULT WINAPI IDirectMusicSynthSinkImpl_SampleToRefTime (LPDIRECTMUSICSYNTHSINK iface, LONGLONG llSampleTime, REFERENCE_TIME* prfTime)
105 ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
107 FIXME("(%p, %lli, %p): stub\n", This, llSampleTime, prfTime);
109 return S_OK;
112 HRESULT WINAPI IDirectMusicSynthSinkImpl_RefTimeToSample (LPDIRECTMUSICSYNTHSINK iface, REFERENCE_TIME rfTime, LONGLONG* pllSampleTime)
114 ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
116 FIXME("(%p, %lli, %p): stub\n", This, rfTime, pllSampleTime );
118 return S_OK;
121 HRESULT WINAPI IDirectMusicSynthSinkImpl_SetDirectSound (LPDIRECTMUSICSYNTHSINK iface, LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer)
123 ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
125 FIXME("(%p, %p, %p): stub\n", This, pDirectSound, pDirectSoundBuffer);
127 return S_OK;
130 HRESULT WINAPI IDirectMusicSynthSinkImpl_GetDesiredBufferSize (LPDIRECTMUSICSYNTHSINK iface, LPDWORD pdwBufferSizeInSamples)
132 ICOM_THIS(IDirectMusicSynthSinkImpl,iface);
134 FIXME("(%p, %p): stub\n", This, pdwBufferSizeInSamples);
136 return S_OK;
139 ICOM_VTABLE(IDirectMusicSynthSink) DirectMusicSynthSink_Vtbl =
141 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
142 IDirectMusicSynthSinkImpl_QueryInterface,
143 IDirectMusicSynthSinkImpl_AddRef,
144 IDirectMusicSynthSinkImpl_Release,
145 IDirectMusicSynthSinkImpl_Init,
146 IDirectMusicSynthSinkImpl_SetMasterClock,
147 IDirectMusicSynthSinkImpl_GetLatencyClock,
148 IDirectMusicSynthSinkImpl_Activate,
149 IDirectMusicSynthSinkImpl_SampleToRefTime,
150 IDirectMusicSynthSinkImpl_RefTimeToSample,
151 IDirectMusicSynthSinkImpl_SetDirectSound,
152 IDirectMusicSynthSinkImpl_GetDesiredBufferSize
155 /* for ClassFactory */
156 HRESULT WINAPI DMUSIC_CreateDirectMusicSynthSink (LPCGUID lpcGUID, LPDIRECTMUSICSYNTHSINK* ppDMSynthSink, LPUNKNOWN pUnkOuter)
158 IDirectMusicSynthSinkImpl *dmsink;
160 TRACE("(%p,%p,%p)\n", lpcGUID, ppDMSynthSink, pUnkOuter);
161 if (IsEqualIID (lpcGUID, &IID_IDirectMusicSynthSink)) {
162 dmsink = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicSynthSinkImpl));
163 if (NULL == dmsink) {
164 *ppDMSynthSink = (LPDIRECTMUSICSYNTHSINK) NULL;
165 return E_OUTOFMEMORY;
167 dmsink->lpVtbl = &DirectMusicSynthSink_Vtbl;
168 dmsink->ref = 1;
169 *ppDMSynthSink = (LPDIRECTMUSICSYNTHSINK) dmsink;
170 return S_OK;
173 WARN("No interface found\n");
174 return E_NOINTERFACE;