1 /* IDirectMusicBuffer 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.
32 #include "wine/windef16.h"
33 #include "wine/winbase16.h"
34 #include "wine/debug.h"
37 #include "dmusic_private.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(dmusic);
41 /* IDirectMusicBuffer IUnknown parts follow: */
42 HRESULT WINAPI IDirectMusicBufferImpl_QueryInterface (LPDIRECTMUSICBUFFER iface, REFIID riid, LPVOID *ppobj)
44 ICOM_THIS(IDirectMusicBufferImpl,iface);
46 if (IsEqualIID (riid, &IID_IUnknown)
47 || IsEqualIID (riid, &IID_IDirectMusicBuffer)) {
48 IDirectMusicBufferImpl_AddRef(iface);
53 WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj);
57 ULONG WINAPI IDirectMusicBufferImpl_AddRef (LPDIRECTMUSICBUFFER iface)
59 ICOM_THIS(IDirectMusicBufferImpl,iface);
60 TRACE("(%p) : AddRef from %ld\n", This, This->ref);
64 ULONG WINAPI IDirectMusicBufferImpl_Release (LPDIRECTMUSICBUFFER iface)
66 ICOM_THIS(IDirectMusicBufferImpl,iface);
67 ULONG ref = --This->ref;
68 TRACE("(%p) : ReleaseRef to %ld\n", This, This->ref);
70 HeapFree(GetProcessHeap(), 0, This);
75 /* IDirectMusicBuffer Interface follow: */
76 HRESULT WINAPI IDirectMusicBufferImpl_Flush (LPDIRECTMUSICBUFFER iface)
78 ICOM_THIS(IDirectMusicBufferImpl,iface);
80 FIXME("(%p): stub\n", This);
85 HRESULT WINAPI IDirectMusicBufferImpl_TotalTime (LPDIRECTMUSICBUFFER iface, LPREFERENCE_TIME prtTime)
87 ICOM_THIS(IDirectMusicBufferImpl,iface);
89 FIXME("(%p, %p): stub\n", This, prtTime);
94 HRESULT WINAPI IDirectMusicBufferImpl_PackStructured (LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt, DWORD dwChannelGroup, DWORD dwChannelMessage)
96 ICOM_THIS(IDirectMusicBufferImpl,iface);
98 FIXME("(%p, %lli, %ld, %ld): stub\n", This, rt, dwChannelGroup, dwChannelMessage);
103 HRESULT WINAPI IDirectMusicBufferImpl_PackUnstructured (LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt, DWORD dwChannelGroup, DWORD cb, LPBYTE lpb)
105 ICOM_THIS(IDirectMusicBufferImpl,iface);
107 FIXME("(%p, %lli, %ld, %ld, %p): stub\n", This, rt, dwChannelGroup, cb, lpb);
112 HRESULT WINAPI IDirectMusicBufferImpl_ResetReadPtr (LPDIRECTMUSICBUFFER iface)
114 ICOM_THIS(IDirectMusicBufferImpl,iface);
116 FIXME("(%p): stub\n", This);
121 HRESULT WINAPI IDirectMusicBufferImpl_GetNextEvent (LPDIRECTMUSICBUFFER iface, LPREFERENCE_TIME prt, LPDWORD pdwChannelGroup, LPDWORD pdwLength, LPBYTE* ppData)
123 ICOM_THIS(IDirectMusicBufferImpl,iface);
125 FIXME("(%p, %p, %p, %p, %p): stub\n", This, prt, pdwChannelGroup, pdwLength, ppData);
130 HRESULT WINAPI IDirectMusicBufferImpl_GetRawBufferPtr (LPDIRECTMUSICBUFFER iface, LPBYTE* ppData)
132 ICOM_THIS(IDirectMusicBufferImpl,iface);
134 FIXME("(%p, %p): stub\n", This, ppData);
139 HRESULT WINAPI IDirectMusicBufferImpl_GetStartTime (LPDIRECTMUSICBUFFER iface, LPREFERENCE_TIME prt)
141 ICOM_THIS(IDirectMusicBufferImpl,iface);
143 FIXME("(%p, %p): stub\n", This, prt);
148 HRESULT WINAPI IDirectMusicBufferImpl_GetUsedBytes (LPDIRECTMUSICBUFFER iface, LPDWORD pcb)
150 ICOM_THIS(IDirectMusicBufferImpl,iface);
152 FIXME("(%p, %p): stub\n", This, pcb);
157 HRESULT WINAPI IDirectMusicBufferImpl_GetMaxBytes (LPDIRECTMUSICBUFFER iface, LPDWORD pcb)
159 ICOM_THIS(IDirectMusicBufferImpl,iface);
161 FIXME("(%p, %p): stub\n", This, pcb);
166 HRESULT WINAPI IDirectMusicBufferImpl_GetBufferFormat (LPDIRECTMUSICBUFFER iface, LPGUID pGuidFormat)
168 ICOM_THIS(IDirectMusicBufferImpl,iface);
170 FIXME("(%p, %p): stub\n", This, pGuidFormat);
175 HRESULT WINAPI IDirectMusicBufferImpl_SetStartTime (LPDIRECTMUSICBUFFER iface, REFERENCE_TIME rt)
177 ICOM_THIS(IDirectMusicBufferImpl,iface);
179 FIXME("(%p, %lli): stub\n", This, rt);
184 HRESULT WINAPI IDirectMusicBufferImpl_SetUsedBytes (LPDIRECTMUSICBUFFER iface, DWORD cb)
186 ICOM_THIS(IDirectMusicBufferImpl,iface);
188 FIXME("(%p, %ld): stub\n", This, cb);
193 ICOM_VTABLE(IDirectMusicBuffer) DirectMusicBuffer_Vtbl =
195 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
196 IDirectMusicBufferImpl_QueryInterface,
197 IDirectMusicBufferImpl_AddRef,
198 IDirectMusicBufferImpl_Release,
199 IDirectMusicBufferImpl_Flush,
200 IDirectMusicBufferImpl_TotalTime,
201 IDirectMusicBufferImpl_PackStructured,
202 IDirectMusicBufferImpl_PackUnstructured,
203 IDirectMusicBufferImpl_ResetReadPtr,
204 IDirectMusicBufferImpl_GetNextEvent,
205 IDirectMusicBufferImpl_GetRawBufferPtr,
206 IDirectMusicBufferImpl_GetStartTime,
207 IDirectMusicBufferImpl_GetUsedBytes,
208 IDirectMusicBufferImpl_GetMaxBytes,
209 IDirectMusicBufferImpl_GetBufferFormat,
210 IDirectMusicBufferImpl_SetStartTime,
211 IDirectMusicBufferImpl_SetUsedBytes
214 /* for ClassFactory */
215 HRESULT WINAPI DMUSIC_CreateDirectMusicBuffer (LPCGUID lpcGUID, LPDIRECTMUSICBUFFER* ppDMBuff, LPUNKNOWN pUnkOuter)
217 if (IsEqualIID (lpcGUID, &IID_IDirectMusicBuffer)) {
219 return E_NOINTERFACE;
222 WARN("No interface found\n");
223 return E_NOINTERFACE;