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.
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);
42 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
46 ULONG WINAPI IDirectMusicPortImpl_AddRef (LPDIRECTMUSICPORT iface)
48 ICOM_THIS(IDirectMusicPortImpl,iface);
49 TRACE("(%p) : AddRef from %ld\n", This, 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);
60 HeapFree(GetProcessHeap(), 0, This);
65 /* IDirectMusicPort Interface follow: */
66 HRESULT WINAPI IDirectMusicPortImpl_PlayBuffer (LPDIRECTMUSICPORT iface, LPDIRECTMUSICBUFFER pBuffer)
72 HRESULT WINAPI IDirectMusicPortImpl_SetReadNotificationHandle (LPDIRECTMUSICPORT iface, HANDLE hEvent)
78 HRESULT WINAPI IDirectMusicPortImpl_Read (LPDIRECTMUSICPORT iface, LPDIRECTMUSICBUFFER pBuffer)
84 HRESULT WINAPI IDirectMusicPortImpl_DownloadInstrument (LPDIRECTMUSICPORT iface, IDirectMusicInstrument* pInstrument, IDirectMusicDownloadedInstrument** ppDownloadedInstrument, DMUS_NOTERANGE* pNoteRanges, DWORD dwNumNoteRanges)
90 HRESULT WINAPI IDirectMusicPortImpl_UnloadInstrument (LPDIRECTMUSICPORT iface, IDirectMusicDownloadedInstrument *pDownloadedInstrument)
96 HRESULT WINAPI IDirectMusicPortImpl_GetLatencyClock (LPDIRECTMUSICPORT iface, IReferenceClock** ppClock)
102 HRESULT WINAPI IDirectMusicPortImpl_GetRunningStats (LPDIRECTMUSICPORT iface, LPDMUS_SYNTHSTATS pStats)
108 HRESULT WINAPI IDirectMusicPortImpl_GetCaps (LPDIRECTMUSICPORT iface, LPDMUS_PORTCAPS pPortCaps)
110 ICOM_THIS(IDirectMusicPortImpl,iface);
112 TRACE("(%p, %p)\n", This, pPortCaps);
113 pPortCaps = This->caps;
118 HRESULT WINAPI IDirectMusicPortImpl_DeviceIoControl (LPDIRECTMUSICPORT iface, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped)
124 HRESULT WINAPI IDirectMusicPortImpl_SetNumChannelGroups (LPDIRECTMUSICPORT iface, DWORD dwChannelGroups)
130 HRESULT WINAPI IDirectMusicPortImpl_GetNumChannelGroups (LPDIRECTMUSICPORT iface, LPDWORD pdwChannelGroups)
136 HRESULT WINAPI IDirectMusicPortImpl_Activate (LPDIRECTMUSICPORT iface, BOOL fActive)
142 HRESULT WINAPI IDirectMusicPortImpl_SetChannelPriority (LPDIRECTMUSICPORT iface, DWORD dwChannelGroup, DWORD dwChannel, DWORD dwPriority)
148 HRESULT WINAPI IDirectMusicPortImpl_GetChannelPriority (LPDIRECTMUSICPORT iface, DWORD dwChannelGroup, DWORD dwChannel, LPDWORD pdwPriority)
154 HRESULT WINAPI IDirectMusicPortImpl_SetDirectSound (LPDIRECTMUSICPORT iface, LPDIRECTSOUND pDirectSound, LPDIRECTSOUNDBUFFER pDirectSoundBuffer)
160 HRESULT WINAPI IDirectMusicPortImpl_GetFormat (LPDIRECTMUSICPORT iface, LPWAVEFORMATEX pWaveFormatEx, LPDWORD pdwWaveFormatExSize, LPDWORD pdwBufferSize)
166 ICOM_VTABLE(IDirectMusicPort) DirectMusicPort_Vtbl =
168 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
169 IDirectMusicPortImpl_QueryInterface,
170 IDirectMusicPortImpl_AddRef,
171 IDirectMusicPortImpl_Release,
172 IDirectMusicPortImpl_PlayBuffer,
173 IDirectMusicPortImpl_SetReadNotificationHandle,
174 IDirectMusicPortImpl_Read,
175 IDirectMusicPortImpl_DownloadInstrument,
176 IDirectMusicPortImpl_UnloadInstrument,
177 IDirectMusicPortImpl_GetLatencyClock,
178 IDirectMusicPortImpl_GetRunningStats,
179 IDirectMusicPortImpl_GetCaps,
180 IDirectMusicPortImpl_DeviceIoControl,
181 IDirectMusicPortImpl_SetNumChannelGroups,
182 IDirectMusicPortImpl_GetNumChannelGroups,
183 IDirectMusicPortImpl_Activate,
184 IDirectMusicPortImpl_SetChannelPriority,
185 IDirectMusicPortImpl_GetChannelPriority,
186 IDirectMusicPortImpl_SetDirectSound,
187 IDirectMusicPortImpl_GetFormat
191 /* IDirectMusicPortDownload IUnknown parts follow: */
192 HRESULT WINAPI IDirectMusicPortDownloadImpl_QueryInterface (LPDIRECTMUSICPORTDOWNLOAD iface, REFIID riid, LPVOID *ppobj)
194 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
196 if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPortDownload))
198 IDirectMusicPortDownloadImpl_AddRef(iface);
202 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
203 return E_NOINTERFACE;
206 ULONG WINAPI IDirectMusicPortDownloadImpl_AddRef (LPDIRECTMUSICPORTDOWNLOAD iface)
208 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
209 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
210 return ++(This->ref);
213 ULONG WINAPI IDirectMusicPortDownloadImpl_Release (LPDIRECTMUSICPORTDOWNLOAD iface)
215 ICOM_THIS(IDirectMusicPortDownloadImpl,iface);
216 ULONG ref = --This->ref;
217 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
220 HeapFree(GetProcessHeap(), 0, This);
225 /* IDirectMusicPortDownload Interface follow: */
226 HRESULT WINAPI IDirectMusicPortDownloadImpl_GetBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwDLId, IDirectMusicDownload** ppIDMDownload)
232 HRESULT WINAPI IDirectMusicPortDownloadImpl_AllocateBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwSize, IDirectMusicDownload** ppIDMDownload)
238 HRESULT WINAPI IDirectMusicPortDownloadImpl_GetDLId (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwStartDLId, DWORD dwCount)
244 HRESULT WINAPI IDirectMusicPortDownloadImpl_GetAppend (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD* pdwAppend)
250 HRESULT WINAPI IDirectMusicPortDownloadImpl_Download (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload)
256 HRESULT WINAPI IDirectMusicPortDownloadImpl_Unload (LPDIRECTMUSICPORTDOWNLOAD iface, IDirectMusicDownload* pIDMDownload)
262 ICOM_VTABLE(IDirectMusicPortDownload) DirectMusicPortDownload_Vtbl =
264 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
265 IDirectMusicPortDownloadImpl_QueryInterface,
266 IDirectMusicPortDownloadImpl_AddRef,
267 IDirectMusicPortDownloadImpl_Release,
268 IDirectMusicPortDownloadImpl_GetBuffer,
269 IDirectMusicPortDownloadImpl_AllocateBuffer,
270 IDirectMusicPortDownloadImpl_GetDLId,
271 IDirectMusicPortDownloadImpl_GetAppend,
272 IDirectMusicPortDownloadImpl_Download,
273 IDirectMusicPortDownloadImpl_Unload