1 /* IDirectMusicMarkerTrack 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.
26 #include "wine/debug.h"
28 #include "dmime_private.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(dmime
);
31 WINE_DECLARE_DEBUG_CHANNEL(dmfile
);
33 /*****************************************************************************
34 * IDirectMusicMarkerTrack implementation
36 /* IDirectMusicMarkerTrack IUnknown part: */
37 HRESULT WINAPI
IDirectMusicMarkerTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface
, REFIID riid
, LPVOID
*ppobj
)
39 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
41 if (IsEqualIID (riid
, &IID_IUnknown
) ||
42 IsEqualIID (riid
, &IID_IDirectMusicTrack
) ||
43 IsEqualIID (riid
, &IID_IDirectMusicTrack8
)) {
44 IDirectMusicMarkerTrack_AddRef(iface
);
47 } else if (IsEqualIID (riid
, &IID_IPersistStream
)) {
48 IDirectMusicMarkerTrackStream_AddRef ((LPPERSISTSTREAM
)This
->pStream
);
49 *ppobj
= This
->pStream
;
53 WARN("(%p)->(%s,%p),not found\n", This
, debugstr_guid(riid
), ppobj
);
57 ULONG WINAPI
IDirectMusicMarkerTrack_AddRef (LPDIRECTMUSICTRACK8 iface
)
59 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
60 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
64 ULONG WINAPI
IDirectMusicMarkerTrack_Release (LPDIRECTMUSICTRACK8 iface
)
66 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
67 ULONG ref
= --This
->ref
;
68 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
70 HeapFree(GetProcessHeap(), 0, This
);
75 /* IDirectMusicMarkerTrack IDirectMusicTrack part: */
76 HRESULT WINAPI
IDirectMusicMarkerTrack_Init (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegment
* pSegment
)
78 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
80 FIXME("(%p, %p): stub\n", This
, pSegment
);
85 HRESULT WINAPI
IDirectMusicMarkerTrack_InitPlay (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegmentState
* pSegmentState
, IDirectMusicPerformance
* pPerformance
, void** ppStateData
, DWORD dwVirtualTrack8ID
, DWORD dwFlags
)
87 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
89 FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This
, pSegmentState
, pPerformance
, ppStateData
, dwVirtualTrack8ID
, dwFlags
);
94 HRESULT WINAPI
IDirectMusicMarkerTrack_EndPlay (LPDIRECTMUSICTRACK8 iface
, void* pStateData
)
96 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
98 FIXME("(%p, %p): stub\n", This
, pStateData
);
103 HRESULT WINAPI
IDirectMusicMarkerTrack_Play (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, MUSIC_TIME mtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
)
105 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
107 FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This
, pStateData
, mtStart
, mtEnd
, mtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
112 HRESULT WINAPI
IDirectMusicMarkerTrack_GetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, MUSIC_TIME
* pmtNext
, void* pParam
)
114 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
116 FIXME("(%p, %s, %ld, %p, %p): stub\n", This
, debugstr_guid(rguidType
), mtTime
, pmtNext
, pParam
);
121 HRESULT WINAPI
IDirectMusicMarkerTrack_SetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, void* pParam
)
123 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
125 FIXME("(%p, %s, %ld, %p): stub\n", This
, debugstr_guid(rguidType
), mtTime
, pParam
);
130 HRESULT WINAPI
IDirectMusicMarkerTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
)
132 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
134 TRACE("(%p, %s): ", This
, debugstr_guid(rguidType
));
135 if (IsEqualGUID (rguidType
, &GUID_Play_Marker
)
136 || IsEqualGUID (rguidType
, &GUID_Valid_Start_Time
)) {
137 TRACE("param supported\n");
141 TRACE("param unsupported\n");
142 return DMUS_E_TYPE_UNSUPPORTED
;
145 HRESULT WINAPI
IDirectMusicMarkerTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
)
147 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
149 FIXME("(%p, %s): stub\n", This
, debugstr_guid(rguidNotificationType
));
154 HRESULT WINAPI
IDirectMusicMarkerTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
)
156 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
158 FIXME("(%p, %s): stub\n", This
, debugstr_guid(rguidNotificationType
));
163 HRESULT WINAPI
IDirectMusicMarkerTrack_Clone (LPDIRECTMUSICTRACK8 iface
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, IDirectMusicTrack
** ppTrack
)
165 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
167 FIXME("(%p, %ld, %ld, %p): stub\n", This
, mtStart
, mtEnd
, ppTrack
);
172 /* IDirectMusicMarkerTrack IDirectMusicTrack8 part: */
173 HRESULT WINAPI
IDirectMusicMarkerTrack_PlayEx (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, REFERENCE_TIME rtStart
, REFERENCE_TIME rtEnd
, REFERENCE_TIME rtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
)
175 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
177 FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This
, pStateData
, rtStart
, rtEnd
, rtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
182 HRESULT WINAPI
IDirectMusicMarkerTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, REFERENCE_TIME
* prtNext
, void* pParam
, void* pStateData
, DWORD dwFlags
)
184 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
186 FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This
, debugstr_guid(rguidType
), rtTime
, prtNext
, pParam
, pStateData
, dwFlags
);
191 HRESULT WINAPI
IDirectMusicMarkerTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, void* pParam
, void* pStateData
, DWORD dwFlags
)
193 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
195 FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This
, debugstr_guid(rguidType
), rtTime
, pParam
, pStateData
, dwFlags
);
200 HRESULT WINAPI
IDirectMusicMarkerTrack_Compose (LPDIRECTMUSICTRACK8 iface
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
)
202 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
204 FIXME("(%p, %p, %ld, %p): stub\n", This
, pContext
, dwTrackGroup
, ppResultTrack
);
209 HRESULT WINAPI
IDirectMusicMarkerTrack_Join (LPDIRECTMUSICTRACK8 iface
, IDirectMusicTrack
* pNewTrack
, MUSIC_TIME mtJoin
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
)
211 ICOM_THIS(IDirectMusicMarkerTrack
,iface
);
213 FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This
, pNewTrack
, mtJoin
, pContext
, dwTrackGroup
, ppResultTrack
);
218 ICOM_VTABLE(IDirectMusicTrack8
) DirectMusicMarkerTrack_Vtbl
=
220 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
221 IDirectMusicMarkerTrack_QueryInterface
,
222 IDirectMusicMarkerTrack_AddRef
,
223 IDirectMusicMarkerTrack_Release
,
224 IDirectMusicMarkerTrack_Init
,
225 IDirectMusicMarkerTrack_InitPlay
,
226 IDirectMusicMarkerTrack_EndPlay
,
227 IDirectMusicMarkerTrack_Play
,
228 IDirectMusicMarkerTrack_GetParam
,
229 IDirectMusicMarkerTrack_SetParam
,
230 IDirectMusicMarkerTrack_IsParamSupported
,
231 IDirectMusicMarkerTrack_AddNotificationType
,
232 IDirectMusicMarkerTrack_RemoveNotificationType
,
233 IDirectMusicMarkerTrack_Clone
,
234 IDirectMusicMarkerTrack_PlayEx
,
235 IDirectMusicMarkerTrack_GetParamEx
,
236 IDirectMusicMarkerTrack_SetParamEx
,
237 IDirectMusicMarkerTrack_Compose
,
238 IDirectMusicMarkerTrack_Join
241 /* for ClassFactory */
242 HRESULT WINAPI
DMUSIC_CreateDirectMusicMarkerTrack (LPCGUID lpcGUID
, LPDIRECTMUSICTRACK8
*ppTrack
, LPUNKNOWN pUnkOuter
)
244 IDirectMusicMarkerTrack
* track
;
246 if (IsEqualIID (lpcGUID
, &IID_IDirectMusicTrack
)
247 || IsEqualIID (lpcGUID
, &IID_IDirectMusicTrack8
)) {
248 track
= HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicMarkerTrack
));
250 *ppTrack
= (LPDIRECTMUSICTRACK8
) NULL
;
251 return E_OUTOFMEMORY
;
253 track
->lpVtbl
= &DirectMusicMarkerTrack_Vtbl
;
255 track
->pStream
= HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicMarkerTrackStream
));
256 track
->pStream
->lpVtbl
= &DirectMusicMarkerTrackStream_Vtbl
;
257 track
->pStream
->ref
= 1;
258 track
->pStream
->pParentTrack
= track
;
259 *ppTrack
= (LPDIRECTMUSICTRACK8
) track
;
262 WARN("No interface found\n");
264 return E_NOINTERFACE
;
268 /*****************************************************************************
269 * IDirectMusicMarkerTrackStream implementation
271 /* IDirectMusicMarkerTrackStream IUnknown part follow: */
272 HRESULT WINAPI
IDirectMusicMarkerTrackStream_QueryInterface (LPPERSISTSTREAM iface
, REFIID riid
, LPVOID
*ppobj
)
274 ICOM_THIS(IDirectMusicMarkerTrackStream
,iface
);
276 if (IsEqualIID (riid
, &IID_IUnknown
)
277 || IsEqualIID (riid
, &IID_IPersistStream
)) {
278 IDirectMusicMarkerTrackStream_AddRef(iface
);
283 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
284 return E_NOINTERFACE
;
287 ULONG WINAPI
IDirectMusicMarkerTrackStream_AddRef (LPPERSISTSTREAM iface
)
289 ICOM_THIS(IDirectMusicMarkerTrackStream
,iface
);
290 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
291 return ++(This
->ref
);
294 ULONG WINAPI
IDirectMusicMarkerTrackStream_Release (LPPERSISTSTREAM iface
)
296 ICOM_THIS(IDirectMusicMarkerTrackStream
,iface
);
297 ULONG ref
= --This
->ref
;
298 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
300 HeapFree(GetProcessHeap(), 0, This
);
305 /* IDirectMusicMarkerTrackStream IPersist part: */
306 HRESULT WINAPI
IDirectMusicMarkerTrackStream_GetClassID (LPPERSISTSTREAM iface
, CLSID
* pClassID
)
311 /* IDirectMusicMarkerTrackStream IPersistStream part: */
312 HRESULT WINAPI
IDirectMusicMarkerTrackStream_IsDirty (LPPERSISTSTREAM iface
)
317 HRESULT WINAPI
IDirectMusicMarkerTrackStream_Load (LPPERSISTSTREAM iface
, IStream
* pStm
)
319 FIXME(": Loading not implemented yet\n");
323 HRESULT WINAPI
IDirectMusicMarkerTrackStream_Save (LPPERSISTSTREAM iface
, IStream
* pStm
, BOOL fClearDirty
)
328 HRESULT WINAPI
IDirectMusicMarkerTrackStream_GetSizeMax (LPPERSISTSTREAM iface
, ULARGE_INTEGER
* pcbSize
)
333 ICOM_VTABLE(IPersistStream
) DirectMusicMarkerTrackStream_Vtbl
=
335 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
336 IDirectMusicMarkerTrackStream_QueryInterface
,
337 IDirectMusicMarkerTrackStream_AddRef
,
338 IDirectMusicMarkerTrackStream_Release
,
339 IDirectMusicMarkerTrackStream_GetClassID
,
340 IDirectMusicMarkerTrackStream_IsDirty
,
341 IDirectMusicMarkerTrackStream_Load
,
342 IDirectMusicMarkerTrackStream_Save
,
343 IDirectMusicMarkerTrackStream_GetSizeMax