Add "-wrap" to the wrapped app, to avoid possible name conflicts.
[wine/hacks.git] / dlls / dmusic / dmusic_port.c
blob7c0cc77b03e9b55ec23a63d6cffa4e2a58950c49
1 /* IDirectMusicPort Implementation
2 * IDirectMusicPortDownloadImpl Implementation
4 * Copyright (C) 2003 Rok Mandeljc
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.
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.
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.
21 #include "windef.h"
22 #include "winbase.h"
23 #include "winuser.h"
24 #include "wingdi.h"
25 #include "wine/debug.h"
27 #include "dmusic_private.h"
29 WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
31 /* IDirectMusicPort IUnknown parts follow: */
32 HRESULT WINAPI IDirectMusicPortImpl_QueryInterface (LPDIRECTMUSICPORT iface, REFIID riid, LPVOID *ppobj)
34 ICOM_THIS(IDirectMusicPortImpl,iface);
36 if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPort))
38 IDirectMusicPortImpl_AddRef(iface);
39 *ppobj = This;
40 return S_OK;
42 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
43 return E_NOINTERFACE;
46 ULONG WINAPI IDirectMusicPortImpl_AddRef (LPDIRECTMUSICPORT iface)
48 ICOM_THIS(IDirectMusicPortImpl,iface);
49 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
50 return ++(This->ref);
53 ULONG WINAPI IDirectMusicPortImpl_Release (LPDIRECTMUSICPORT iface)
55 ICOM_THIS(IDirectMusicPortImpl,iface);
56 ULONG ref = --This->ref;
57 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
58 if (ref == 0)
60 HeapFree(GetProcessHeap(), 0, This);
62 return ref;
65 /* IDirectMusicPort Interface follow: */
66 HRESULT WINAPI IDirectMusicPortImpl_PlayBuffer (LPDIRECTMUSICPORT iface, LPDIRECTMUSICBUFFER pBuffer)
68 ICOM_THIS(IDirectMusicPortImpl,iface);
70 FIXME("(%p, %p): stub\n", This, pBuffer);
72 return S_OK;
75 HRESULT WINAPI IDirectMusicPortImpl_SetReadNotificationHandle (LPDIRECTMUSICPORT iface, HANDLE hEvent)
77 ICOM_THIS(IDirectMusicPortImpl,iface);
79 FIXME("(%p, %p): stub\n", This, hEvent);
81 return S_OK;
84 HRESULT WINAPI IDirectMusicPortImpl_Read (LPDIRECTMUSICPORT iface, LPDIRECTMUSICBUFFER pBuffer)
86 ICOM_THIS(IDirectMusicPortImpl,iface);
88 FIXME("(%p, %p): stub\n", This, pBuffer);
90 return S_OK;
93 HRESULT WINAPI IDirectMusicPortImpl_DownloadInstrument (LPDIRECTMUSICPORT iface, IDirectMusicInstrument* pInstrument, IDirectMusicDownloadedInstrument** ppDownloadedInstrument, DMUS_NOTERANGE* pNoteRanges, DWORD dwNumNoteRanges)
95 ICOM_THIS(IDirectMusicPortImpl,iface);
97 FIXME("(%p, %p, %p, %p, %ld): stub\n", This, pInstrument, ppDownloadedInstrument, pNoteRanges, dwNumNoteRanges);
99 return S_OK;
102 HRESULT WINAPI IDirectMusicPortImpl_UnloadInstrument (LPDIRECTMUSICPORT iface, IDirectMusicDownloadedInstrument *pDownloadedInstrument)
104 ICOM_THIS(IDirectMusicPortImpl,iface);
106 FIXME("(%p, %p): stub\n", This, pDownloadedInstrument);
108 return S_OK;
111 HRESULT WINAPI IDirectMusicPortImpl_GetLatencyClock (LPDIRECTMUSICPORT iface, IReferenceClock** ppClock)
113 ICOM_THIS(IDirectMusicPortImpl,iface);
115 FIXME("(%p, %p): stub\n", This, ppClock);
117 return S_OK;
120 HRESULT WINAPI IDirectMusicPortImpl_GetRunningStats (LPDIRECTMUSICPORT iface, LPDMUS_SYNTHSTATS pStats)
122 ICOM_THIS(IDirectMusicPortImpl,iface);
124 FIXME("(%p, %p): stub\n", This, pStats);
126 return S_OK;
129 HRESULT WINAPI IDirectMusicPortImpl_GetCaps (LPDIRECTMUSICPORT iface, LPDMUS_PORTCAPS pPortCaps)
131 ICOM_THIS(IDirectMusicPortImpl,iface);
133 TRACE("(%p, %p)\n", This, pPortCaps);
134 pPortCaps = This->caps;
136 return S_OK;
139 HRESULT WINAPI IDirectMusicPortImpl_DeviceIoControl (LPDIRECTMUSICPORT iface, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped)
141 ICOM_THIS(IDirectMusicPortImpl,iface);
143 FIXME("(%p, %ld, %p, %ld, %p, %ld, %p, %p): stub\n", This, dwIoControlCode, lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, lpBytesReturned, lpOverlapped);
145 return S_OK;
148 HRESULT WINAPI IDirectMusicPortImpl_SetNumChannelGroups (LPDIRECTMUSICPORT iface, DWORD dwChannelGroups)
150 ICOM_THIS(IDirectMusicPortImpl,iface);
152 FIXME("(%p, %ld): semi-stub\n", This, dwChannelGroups);
153 This->nrofgroups = dwChannelGroups;
155 return S_OK;
158 HRESULT WINAPI IDirectMusicPortImpl_GetNumChannelGroups (LPDIRECTMUSICPORT iface, LPDWORD pdwChannelGroups)
160 ICOM_THIS(IDirectMusicPortImpl,iface);
162 TRACE("(%p, %p)\n", This, pdwChannelGroups);
163 *pdwChannelGroups = This->nrofgroups;
165 return S_OK;
168 HRESULT WINAPI IDirectMusicPortImpl_Activate (LPDIRECTMUSICPORT iface, BOOL fActive)
170 ICOM_THIS(IDirectMusicPortImpl,iface);
172 TRACE("(%p, %d)\n", This, fActive);
173 This->active = fActive;
175 return S_OK;
178 HRESULT WINAPI IDirectMusicPortImpl_SetChannelPriority (LPDIRECTMUSICPORT iface, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority)
180 ICOM_THIS(IDirectMusicPortImpl,iface);
182 FIXME("(%p, %ld, %ld, %ld): semi-stub\n", This, dwChannelGroup, dwChannel, dwPriority);
184 if (dwChannel > 16)
186 WARN("isn't there supposed to be 16 channels (no. %ld requested)?! (faking as it is ok)\n", dwChannel);
187 /*return E_INVALIDARG;*/
190 return S_OK;
193 HRESULT WINAPI IDirectMusicPortImpl_GetChannelPriority (LPDIRECTMUSICPORT iface, DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority)
195 ICOM_THIS(IDirectMusicPortImpl,iface);
197 TRACE("(%p, %ld, %ld, %p)\n", This, dwChannelGroup, dwChannel, pdwPriority);
198 *pdwPriority = This->group[dwChannelGroup-1].channel[dwChannel].priority;
200 return S_OK;
203 HRESULT WINAPI IDirectMusicPortImpl_SetDirectSound (LPDIRECTMUSICPORT iface, LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer)
205 ICOM_THIS(IDirectMusicPortImpl,iface);
207 FIXME("(%p, %p, %p): stub\n", This, pDirectSound, pDirectSoundBuffer);
209 return S_OK;
212 HRESULT WINAPI IDirectMusicPortImpl_GetFormat (LPDIRECTMUSICPORT iface, LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSize, LPDWORD pdwBufferSize)
214 ICOM_THIS(IDirectMusicPortImpl,iface);
216 FIXME("(%p, %p, %p, %p): stub\n", This, pWaveFormatEx, pdwWaveFormatExSize, pdwBufferSize);
218 return S_OK;
221 ICOM_VTABLE(IDirectMusicPort) DirectMusicPort_Vtbl =
223 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
224 IDirectMusicPortImpl_QueryInterface,
225 IDirectMusicPortImpl_AddRef,
226 IDirectMusicPortImpl_Release,
227 IDirectMusicPortImpl_PlayBuffer,
228 IDirectMusicPortImpl_SetReadNotificationHandle,
229 IDirectMusicPortImpl_Read,
230 IDirectMusicPortImpl_DownloadInstrument,
231 IDirectMusicPortImpl_UnloadInstrument,
232 IDirectMusicPortImpl_GetLatencyClock,
233 IDirectMusicPortImpl_GetRunningStats,
234 IDirectMusicPortImpl_GetCaps,
235 IDirectMusicPortImpl_DeviceIoControl,
236 IDirectMusicPortImpl_SetNumChannelGroups,
237 IDirectMusicPortImpl_GetNumChannelGroups,
238 IDirectMusicPortImpl_Activate,
239 IDirectMusicPortImpl_SetChannelPriority,
240 IDirectMusicPortImpl_GetChannelPriority,
241 IDirectMusicPortImpl_SetDirectSound,
242 IDirectMusicPortImpl_GetFormat
246 /* IDirectMusicPortDownload IUnknown parts follow: */
247 HRESULT WINAPI IDirectMusicPortDownloadImpl_QueryInterface (LPDIRECTMUSICPORTDOWNLOAD iface, REFIID riid, LPVOID *ppobj)
249 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
251 if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPortDownload))
253 IDirectMusicPortDownloadImpl_AddRef(iface);
254 *ppobj = This;
255 return S_OK;
257 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
258 return E_NOINTERFACE;
261 ULONG WINAPI IDirectMusicPortDownloadImpl_AddRef (LPDIRECTMUSICPORTDOWNLOAD iface)
263 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
264 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
265 return ++(This->ref);
268 ULONG WINAPI IDirectMusicPortDownloadImpl_Release (LPDIRECTMUSICPORTDOWNLOAD iface)
270 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
271 ULONG ref = --This->ref;
272 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
273 if (ref == 0)
275 HeapFree(GetProcessHeap(), 0, This);
277 return ref;
280 /* IDirectMusicPortDownload Interface follow: */
281 HRESULT WINAPI IDirectMusicPortDownloadImpl_GetBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwDLId, IDirectMusicDownload** ppIDMDownload)
283 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
285 FIXME("(%p, %ld, %p): stub\n", This, dwDLId, ppIDMDownload);
287 return S_OK;
290 HRESULT WINAPI IDirectMusicPortDownloadImpl_AllocateBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwSize, IDirectMusicDownload** ppIDMDownload)
292 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
294 FIXME("(%p, %ld, %p): stub\n", This, dwSize, ppIDMDownload);
296 return S_OK;
299 HRESULT WINAPI IDirectMusicPortDownloadImpl_GetDLId (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwStartDLId, DWORD dwCount)
301 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
303 FIXME("(%p, %p, %ld): stub\n", This, pdwStartDLId, dwCount);
305 return S_OK;
308 HRESULT WINAPI IDirectMusicPortDownloadImpl_GetAppend (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwAppend)
310 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
312 FIXME("(%p, %p): stub\n", This, pdwAppend);
314 return S_OK;
317 HRESULT WINAPI IDirectMusicPortDownloadImpl_Download (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload)
319 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
321 FIXME("(%p, %p): stub\n", This, pIDMDownload);
323 return S_OK;
326 HRESULT WINAPI IDirectMusicPortDownloadImpl_Unload (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload)
328 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
330 FIXME("(%p, %p): stub\n", This, pIDMDownload);
332 return S_OK;
335 ICOM_VTABLE(IDirectMusicPortDownload) DirectMusicPortDownload_Vtbl =
337 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
338 IDirectMusicPortDownloadImpl_QueryInterface,
339 IDirectMusicPortDownloadImpl_AddRef,
340 IDirectMusicPortDownloadImpl_Release,
341 IDirectMusicPortDownloadImpl_GetBuffer,
342 IDirectMusicPortDownloadImpl_AllocateBuffer,
343 IDirectMusicPortDownloadImpl_GetDLId,
344 IDirectMusicPortDownloadImpl_GetAppend,
345 IDirectMusicPortDownloadImpl_Download,
346 IDirectMusicPortDownloadImpl_Unload