1 /* IDirectMusicMuteTrack Implementation
3 * Copyright (C) 2003-2004 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 "dmstyle_private.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
23 WINE_DECLARE_DEBUG_CHANNEL(dmfile);
25 /*****************************************************************************
26 * IDirectMusicMuteTrack implementation
28 /* IDirectMusicMuteTrack IUnknown part: */
29 HRESULT WINAPI IDirectMusicMuteTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
30 ICOM_THIS_MULTI(IDirectMusicMuteTrack, UnknownVtbl, iface);
31 TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj);
33 if (IsEqualIID (riid, &IID_IUnknown)) {
34 *ppobj = (LPUNKNOWN)&This->UnknownVtbl;
35 IDirectMusicMuteTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
37 } else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
38 || IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
39 *ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
40 IDirectMusicMuteTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
42 } else if (IsEqualIID (riid, &IID_IPersistStream)) {
43 *ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
44 IDirectMusicMuteTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
48 WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
52 ULONG WINAPI IDirectMusicMuteTrack_IUnknown_AddRef (LPUNKNOWN iface) {
53 ICOM_THIS_MULTI(IDirectMusicMuteTrack, UnknownVtbl, iface);
54 TRACE("(%p): AddRef from %ld\n", This, This->ref);
58 ULONG WINAPI IDirectMusicMuteTrack_IUnknown_Release (LPUNKNOWN iface) {
59 ICOM_THIS_MULTI(IDirectMusicMuteTrack, UnknownVtbl, iface);
60 ULONG ref = --This->ref;
61 TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
63 HeapFree(GetProcessHeap(), 0, This);
68 IUnknownVtbl DirectMusicMuteTrack_Unknown_Vtbl = {
69 IDirectMusicMuteTrack_IUnknown_QueryInterface,
70 IDirectMusicMuteTrack_IUnknown_AddRef,
71 IDirectMusicMuteTrack_IUnknown_Release
74 /* IDirectMusicMuteTrack IDirectMusicTrack8 part: */
75 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
76 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
77 return IDirectMusicMuteTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
80 ULONG WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
81 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
82 return IDirectMusicMuteTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
85 ULONG WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
86 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
87 return IDirectMusicMuteTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
90 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
92 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
93 FIXME("(%p, %p): stub\n", This, pSegment);
97 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
99 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
100 FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
104 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
106 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
107 FIXME("(%p, %p): stub\n", This, pStateData);
111 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
113 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
114 FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
118 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
119 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
120 FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_dmguid(rguidType), mtTime, pmtNext, pParam);
124 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
125 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
126 FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_dmguid(rguidType), mtTime, pParam);
130 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
131 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
133 TRACE("(%p, %s): ", This, debugstr_dmguid(rguidType));
134 if (IsEqualGUID (rguidType, &GUID_MuteParam)) {
135 TRACE("param supported\n");
138 TRACE("param unsupported\n");
139 return DMUS_E_TYPE_UNSUPPORTED;
142 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
143 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
144 FIXME("(%p, %s): stub\n", This, debugstr_dmguid(rguidNotificationType));
148 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
149 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
150 FIXME("(%p, %s): stub\n", This, debugstr_dmguid(rguidNotificationType));
154 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
155 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
156 FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
160 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
161 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
162 FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
166 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
167 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
168 FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_dmguid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
172 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
173 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
174 FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_dmguid(rguidType), rtTime, pParam, pStateData, dwFlags);
178 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
179 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
180 FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
184 HRESULT WINAPI IDirectMusicMuteTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
185 ICOM_THIS_MULTI(IDirectMusicMuteTrack, TrackVtbl, iface);
186 FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
190 IDirectMusicTrack8Vtbl DirectMusicMuteTrack_Track_Vtbl = {
191 IDirectMusicMuteTrack_IDirectMusicTrack_QueryInterface,
192 IDirectMusicMuteTrack_IDirectMusicTrack_AddRef,
193 IDirectMusicMuteTrack_IDirectMusicTrack_Release,
194 IDirectMusicMuteTrack_IDirectMusicTrack_Init,
195 IDirectMusicMuteTrack_IDirectMusicTrack_InitPlay,
196 IDirectMusicMuteTrack_IDirectMusicTrack_EndPlay,
197 IDirectMusicMuteTrack_IDirectMusicTrack_Play,
198 IDirectMusicMuteTrack_IDirectMusicTrack_GetParam,
199 IDirectMusicMuteTrack_IDirectMusicTrack_SetParam,
200 IDirectMusicMuteTrack_IDirectMusicTrack_IsParamSupported,
201 IDirectMusicMuteTrack_IDirectMusicTrack_AddNotificationType,
202 IDirectMusicMuteTrack_IDirectMusicTrack_RemoveNotificationType,
203 IDirectMusicMuteTrack_IDirectMusicTrack_Clone,
204 IDirectMusicMuteTrack_IDirectMusicTrack_PlayEx,
205 IDirectMusicMuteTrack_IDirectMusicTrack_GetParamEx,
206 IDirectMusicMuteTrack_IDirectMusicTrack_SetParamEx,
207 IDirectMusicMuteTrack_IDirectMusicTrack_Compose,
208 IDirectMusicMuteTrack_IDirectMusicTrack_Join
211 /* IDirectMusicMuteTrack IPersistStream part: */
212 HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
213 ICOM_THIS_MULTI(IDirectMusicMuteTrack, PersistStreamVtbl, iface);
214 return IDirectMusicMuteTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
217 ULONG WINAPI IDirectMusicMuteTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
218 ICOM_THIS_MULTI(IDirectMusicMuteTrack, PersistStreamVtbl, iface);
219 return IDirectMusicMuteTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
222 ULONG WINAPI IDirectMusicMuteTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
223 ICOM_THIS_MULTI(IDirectMusicMuteTrack, PersistStreamVtbl, iface);
224 return IDirectMusicMuteTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
227 HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
231 HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
235 HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
236 FIXME(": Loading not implemented yet\n");
240 HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
244 HRESULT WINAPI IDirectMusicMuteTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
248 IPersistStreamVtbl DirectMusicMuteTrack_PersistStream_Vtbl = {
249 IDirectMusicMuteTrack_IPersistStream_QueryInterface,
250 IDirectMusicMuteTrack_IPersistStream_AddRef,
251 IDirectMusicMuteTrack_IPersistStream_Release,
252 IDirectMusicMuteTrack_IPersistStream_GetClassID,
253 IDirectMusicMuteTrack_IPersistStream_IsDirty,
254 IDirectMusicMuteTrack_IPersistStream_Load,
255 IDirectMusicMuteTrack_IPersistStream_Save,
256 IDirectMusicMuteTrack_IPersistStream_GetSizeMax
259 /* for ClassFactory */
260 HRESULT WINAPI DMUSIC_CreateDirectMusicMuteTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
261 IDirectMusicMuteTrack* track;
263 track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicMuteTrack));
265 *ppobj = (LPVOID) NULL;
266 return E_OUTOFMEMORY;
268 track->UnknownVtbl = &DirectMusicMuteTrack_Unknown_Vtbl;
269 track->TrackVtbl = &DirectMusicMuteTrack_Track_Vtbl;
270 track->PersistStreamVtbl = &DirectMusicMuteTrack_PersistStream_Vtbl;
271 track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
272 DM_STRUCT_INIT(track->pDesc);
273 track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
274 memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicMuteTrack, sizeof (CLSID));
275 track->ref = 0; /* will be inited by QueryInterface */
277 return IDirectMusicMuteTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);