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
);
24 /*****************************************************************************
25 * IDirectMusicMuteTrack implementation
27 /* IDirectMusicMuteTrack IUnknown part: */
28 HRESULT WINAPI
IDirectMusicMuteTrack_IUnknown_QueryInterface (LPUNKNOWN iface
, REFIID riid
, LPVOID
*ppobj
) {
29 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, UnknownVtbl
, iface
);
30 TRACE("(%p, %s, %p)\n", This
, debugstr_dmguid(riid
), ppobj
);
32 if (IsEqualIID (riid
, &IID_IUnknown
)) {
33 *ppobj
= (LPUNKNOWN
)&This
->UnknownVtbl
;
34 IDirectMusicMuteTrack_IUnknown_AddRef ((LPUNKNOWN
)&This
->UnknownVtbl
);
36 } else if (IsEqualIID (riid
, &IID_IDirectMusicTrack
)
37 || IsEqualIID (riid
, &IID_IDirectMusicTrack8
)) {
38 *ppobj
= (LPDIRECTMUSICTRACK8
)&This
->TrackVtbl
;
39 IDirectMusicMuteTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8
)&This
->TrackVtbl
);
41 } else if (IsEqualIID (riid
, &IID_IPersistStream
)) {
42 *ppobj
= (LPPERSISTSTREAM
)&This
->PersistStreamVtbl
;
43 IDirectMusicMuteTrack_IPersistStream_AddRef ((LPPERSISTSTREAM
)&This
->PersistStreamVtbl
);
47 WARN("(%p, %s, %p): not found\n", This
, debugstr_dmguid(riid
), ppobj
);
51 ULONG WINAPI
IDirectMusicMuteTrack_IUnknown_AddRef (LPUNKNOWN iface
) {
52 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, UnknownVtbl
, iface
);
53 ULONG ref
= InterlockedIncrement(&This
->ref
);
55 TRACE("(%p): AddRef from %ld\n", This
, ref
- 1);
62 ULONG WINAPI
IDirectMusicMuteTrack_IUnknown_Release (LPUNKNOWN iface
) {
63 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, UnknownVtbl
, iface
);
64 ULONG ref
= InterlockedDecrement(&This
->ref
);
66 TRACE("(%p): ReleaseRef to %ld\n", This
, ref
);
69 HeapFree(GetProcessHeap(), 0, This
);
72 DMSTYLE_UnlockModule();
77 static const IUnknownVtbl DirectMusicMuteTrack_Unknown_Vtbl
= {
78 IDirectMusicMuteTrack_IUnknown_QueryInterface
,
79 IDirectMusicMuteTrack_IUnknown_AddRef
,
80 IDirectMusicMuteTrack_IUnknown_Release
83 /* IDirectMusicMuteTrack IDirectMusicTrack8 part: */
84 HRESULT WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface
, REFIID riid
, LPVOID
*ppobj
) {
85 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
86 return IDirectMusicMuteTrack_IUnknown_QueryInterface ((LPUNKNOWN
)&This
->UnknownVtbl
, riid
, ppobj
);
89 ULONG WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface
) {
90 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
91 return IDirectMusicMuteTrack_IUnknown_AddRef ((LPUNKNOWN
)&This
->UnknownVtbl
);
94 ULONG WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface
) {
95 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
96 return IDirectMusicMuteTrack_IUnknown_Release ((LPUNKNOWN
)&This
->UnknownVtbl
);
99 HRESULT WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegment
* pSegment
)
101 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
102 FIXME("(%p, %p): stub\n", This
, pSegment
);
106 HRESULT WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegmentState
* pSegmentState
, IDirectMusicPerformance
* pPerformance
, void** ppStateData
, DWORD dwVirtualTrack8ID
, DWORD dwFlags
)
108 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
109 FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This
, pSegmentState
, pPerformance
, ppStateData
, dwVirtualTrack8ID
, dwFlags
);
113 HRESULT WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface
, void* pStateData
)
115 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
116 FIXME("(%p, %p): stub\n", This
, pStateData
);
120 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
)
122 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
123 FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This
, pStateData
, mtStart
, mtEnd
, mtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
127 HRESULT WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, MUSIC_TIME
* pmtNext
, void* pParam
) {
128 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
129 FIXME("(%p, %s, %ld, %p, %p): stub\n", This
, debugstr_dmguid(rguidType
), mtTime
, pmtNext
, pParam
);
133 HRESULT WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, void* pParam
) {
134 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
135 FIXME("(%p, %s, %ld, %p): stub\n", This
, debugstr_dmguid(rguidType
), mtTime
, pParam
);
139 HRESULT WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
) {
140 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
142 TRACE("(%p, %s): ", This
, debugstr_dmguid(rguidType
));
143 if (IsEqualGUID (rguidType
, &GUID_MuteParam
)) {
144 TRACE("param supported\n");
147 TRACE("param unsupported\n");
148 return DMUS_E_TYPE_UNSUPPORTED
;
151 HRESULT WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
) {
152 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
153 FIXME("(%p, %s): stub\n", This
, debugstr_dmguid(rguidNotificationType
));
157 HRESULT WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
) {
158 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
159 FIXME("(%p, %s): stub\n", This
, debugstr_dmguid(rguidNotificationType
));
163 HRESULT WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, IDirectMusicTrack
** ppTrack
) {
164 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
165 FIXME("(%p, %ld, %ld, %p): stub\n", This
, mtStart
, mtEnd
, ppTrack
);
169 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
) {
170 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
171 FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This
, pStateData
, rtStart
, rtEnd
, rtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
175 HRESULT WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, REFERENCE_TIME
* prtNext
, void* pParam
, void* pStateData
, DWORD dwFlags
) {
176 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
177 FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This
, debugstr_dmguid(rguidType
), rtTime
, prtNext
, pParam
, pStateData
, dwFlags
);
181 HRESULT WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, void* pParam
, void* pStateData
, DWORD dwFlags
) {
182 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
183 FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This
, debugstr_dmguid(rguidType
), rtTime
, pParam
, pStateData
, dwFlags
);
187 HRESULT WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
) {
188 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
189 FIXME("(%p, %p, %ld, %p): stub\n", This
, pContext
, dwTrackGroup
, ppResultTrack
);
193 HRESULT WINAPI
IDirectMusicMuteTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface
, IDirectMusicTrack
* pNewTrack
, MUSIC_TIME mtJoin
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
) {
194 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, TrackVtbl
, iface
);
195 FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This
, pNewTrack
, mtJoin
, pContext
, dwTrackGroup
, ppResultTrack
);
199 static const IDirectMusicTrack8Vtbl DirectMusicMuteTrack_Track_Vtbl
= {
200 IDirectMusicMuteTrack_IDirectMusicTrack_QueryInterface
,
201 IDirectMusicMuteTrack_IDirectMusicTrack_AddRef
,
202 IDirectMusicMuteTrack_IDirectMusicTrack_Release
,
203 IDirectMusicMuteTrack_IDirectMusicTrack_Init
,
204 IDirectMusicMuteTrack_IDirectMusicTrack_InitPlay
,
205 IDirectMusicMuteTrack_IDirectMusicTrack_EndPlay
,
206 IDirectMusicMuteTrack_IDirectMusicTrack_Play
,
207 IDirectMusicMuteTrack_IDirectMusicTrack_GetParam
,
208 IDirectMusicMuteTrack_IDirectMusicTrack_SetParam
,
209 IDirectMusicMuteTrack_IDirectMusicTrack_IsParamSupported
,
210 IDirectMusicMuteTrack_IDirectMusicTrack_AddNotificationType
,
211 IDirectMusicMuteTrack_IDirectMusicTrack_RemoveNotificationType
,
212 IDirectMusicMuteTrack_IDirectMusicTrack_Clone
,
213 IDirectMusicMuteTrack_IDirectMusicTrack_PlayEx
,
214 IDirectMusicMuteTrack_IDirectMusicTrack_GetParamEx
,
215 IDirectMusicMuteTrack_IDirectMusicTrack_SetParamEx
,
216 IDirectMusicMuteTrack_IDirectMusicTrack_Compose
,
217 IDirectMusicMuteTrack_IDirectMusicTrack_Join
220 /* IDirectMusicMuteTrack IPersistStream part: */
221 HRESULT WINAPI
IDirectMusicMuteTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface
, REFIID riid
, LPVOID
*ppobj
) {
222 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, PersistStreamVtbl
, iface
);
223 return IDirectMusicMuteTrack_IUnknown_QueryInterface ((LPUNKNOWN
)&This
->UnknownVtbl
, riid
, ppobj
);
226 ULONG WINAPI
IDirectMusicMuteTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface
) {
227 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, PersistStreamVtbl
, iface
);
228 return IDirectMusicMuteTrack_IUnknown_AddRef ((LPUNKNOWN
)&This
->UnknownVtbl
);
231 ULONG WINAPI
IDirectMusicMuteTrack_IPersistStream_Release (LPPERSISTSTREAM iface
) {
232 ICOM_THIS_MULTI(IDirectMusicMuteTrack
, PersistStreamVtbl
, iface
);
233 return IDirectMusicMuteTrack_IUnknown_Release ((LPUNKNOWN
)&This
->UnknownVtbl
);
236 HRESULT WINAPI
IDirectMusicMuteTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface
, CLSID
* pClassID
) {
240 HRESULT WINAPI
IDirectMusicMuteTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface
) {
244 HRESULT WINAPI
IDirectMusicMuteTrack_IPersistStream_Load (LPPERSISTSTREAM iface
, IStream
* pStm
) {
245 FIXME(": Loading not implemented yet\n");
249 HRESULT WINAPI
IDirectMusicMuteTrack_IPersistStream_Save (LPPERSISTSTREAM iface
, IStream
* pStm
, BOOL fClearDirty
) {
253 HRESULT WINAPI
IDirectMusicMuteTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface
, ULARGE_INTEGER
* pcbSize
) {
257 static const IPersistStreamVtbl DirectMusicMuteTrack_PersistStream_Vtbl
= {
258 IDirectMusicMuteTrack_IPersistStream_QueryInterface
,
259 IDirectMusicMuteTrack_IPersistStream_AddRef
,
260 IDirectMusicMuteTrack_IPersistStream_Release
,
261 IDirectMusicMuteTrack_IPersistStream_GetClassID
,
262 IDirectMusicMuteTrack_IPersistStream_IsDirty
,
263 IDirectMusicMuteTrack_IPersistStream_Load
,
264 IDirectMusicMuteTrack_IPersistStream_Save
,
265 IDirectMusicMuteTrack_IPersistStream_GetSizeMax
268 /* for ClassFactory */
269 HRESULT WINAPI
DMUSIC_CreateDirectMusicMuteTrack (LPCGUID lpcGUID
, LPVOID
*ppobj
, LPUNKNOWN pUnkOuter
) {
270 IDirectMusicMuteTrack
* track
;
272 track
= HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicMuteTrack
));
275 return E_OUTOFMEMORY
;
277 track
->UnknownVtbl
= &DirectMusicMuteTrack_Unknown_Vtbl
;
278 track
->TrackVtbl
= &DirectMusicMuteTrack_Track_Vtbl
;
279 track
->PersistStreamVtbl
= &DirectMusicMuteTrack_PersistStream_Vtbl
;
280 track
->pDesc
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(DMUS_OBJECTDESC
));
281 DM_STRUCT_INIT(track
->pDesc
);
282 track
->pDesc
->dwValidData
|= DMUS_OBJ_CLASS
;
283 memcpy (&track
->pDesc
->guidClass
, &CLSID_DirectMusicMuteTrack
, sizeof (CLSID
));
284 track
->ref
= 0; /* will be inited by QueryInterface */
286 return IDirectMusicMuteTrack_IUnknown_QueryInterface ((LPUNKNOWN
)&track
->UnknownVtbl
, lpcGUID
, ppobj
);