1 /* IDirectMusicSignPostTrack 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.
24 #include "wine/debug.h"
26 #include "dmcompos_private.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(dmcompos
);
29 WINE_DECLARE_DEBUG_CHANNEL(dmfile
);
31 /*****************************************************************************
32 * IDirectMusicSignPostTrack implementation
34 /* IDirectMusicSignPostTrack IUnknown part: */
35 HRESULT WINAPI
IDirectMusicSignPostTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface
, REFIID riid
, LPVOID
*ppobj
)
37 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
39 if (IsEqualIID (riid
, &IID_IUnknown
) ||
40 IsEqualIID (riid
, &IID_IDirectMusicTrack
) ||
41 IsEqualIID (riid
, &IID_IDirectMusicTrack8
)) {
42 IDirectMusicSignPostTrack_AddRef(iface
);
45 } else if (IsEqualIID (riid
, &IID_IPersistStream
)) {
46 IDirectMusicSignPostTrackStream_AddRef ((LPPERSISTSTREAM
)This
->pStream
);
47 *ppobj
= This
->pStream
;
51 WARN("(%p)->(%s,%p),not found\n", This
, debugstr_guid(riid
), ppobj
);
55 ULONG WINAPI
IDirectMusicSignPostTrack_AddRef (LPDIRECTMUSICTRACK8 iface
)
57 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
58 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
62 ULONG WINAPI
IDirectMusicSignPostTrack_Release (LPDIRECTMUSICTRACK8 iface
)
64 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
65 ULONG ref
= --This
->ref
;
66 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
68 HeapFree(GetProcessHeap(), 0, This
);
73 /* IDirectMusicSignPostTrack IDirectMusicTrack part: */
74 HRESULT WINAPI
IDirectMusicSignPostTrack_Init (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegment
* pSegment
)
76 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
78 FIXME("(%p, %p): stub\n", This
, pSegment
);
83 HRESULT WINAPI
IDirectMusicSignPostTrack_InitPlay (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegmentState
* pSegmentState
, IDirectMusicPerformance
* pPerformance
, void** ppStateData
, DWORD dwVirtualTrack8ID
, DWORD dwFlags
)
85 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
87 FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This
, pSegmentState
, pPerformance
, ppStateData
, dwVirtualTrack8ID
, dwFlags
);
92 HRESULT WINAPI
IDirectMusicSignPostTrack_EndPlay (LPDIRECTMUSICTRACK8 iface
, void* pStateData
)
94 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
96 FIXME("(%p, %p): stub\n", This
, pStateData
);
101 HRESULT WINAPI
IDirectMusicSignPostTrack_Play (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, MUSIC_TIME mtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
)
103 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
105 FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This
, pStateData
, mtStart
, mtEnd
, mtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
110 HRESULT WINAPI
IDirectMusicSignPostTrack_GetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, MUSIC_TIME
* pmtNext
, void* pParam
)
112 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
114 FIXME("(%p, %s, %ld, %p, %p): stub\n", This
, debugstr_guid(rguidType
), mtTime
, pmtNext
, pParam
);
119 HRESULT WINAPI
IDirectMusicSignPostTrack_SetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, void* pParam
)
121 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
123 FIXME("(%p, %s, %ld, %p): stub\n", This
, debugstr_guid(rguidType
), mtTime
, pParam
);
128 HRESULT WINAPI
IDirectMusicSignPostTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
)
130 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
132 TRACE("(%p, %s): ", This
, debugstr_guid(rguidType
));
133 /* didn't find any params */
135 TRACE("param unsupported\n");
136 return DMUS_E_TYPE_UNSUPPORTED
;
139 HRESULT WINAPI
IDirectMusicSignPostTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
)
141 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
143 FIXME("(%p, %s): stub\n", This
, debugstr_guid(rguidNotificationType
));
148 HRESULT WINAPI
IDirectMusicSignPostTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
)
150 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
152 FIXME("(%p, %s): stub\n", This
, debugstr_guid(rguidNotificationType
));
157 HRESULT WINAPI
IDirectMusicSignPostTrack_Clone (LPDIRECTMUSICTRACK8 iface
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, IDirectMusicTrack
** ppTrack
)
159 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
161 FIXME("(%p, %ld, %ld, %p): stub\n", This
, mtStart
, mtEnd
, ppTrack
);
166 /* IDirectMusicSignPostTrack IDirectMusicTrack8 part: */
167 HRESULT WINAPI
IDirectMusicSignPostTrack_PlayEx (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, REFERENCE_TIME rtStart
, REFERENCE_TIME rtEnd
, REFERENCE_TIME rtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
)
169 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
171 FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This
, pStateData
, rtStart
, rtEnd
, rtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
176 HRESULT WINAPI
IDirectMusicSignPostTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, REFERENCE_TIME
* prtNext
, void* pParam
, void* pStateData
, DWORD dwFlags
)
178 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
180 FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This
, debugstr_guid(rguidType
), rtTime
, prtNext
, pParam
, pStateData
, dwFlags
);
185 HRESULT WINAPI
IDirectMusicSignPostTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, void* pParam
, void* pStateData
, DWORD dwFlags
)
187 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
189 FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This
, debugstr_guid(rguidType
), rtTime
, pParam
, pStateData
, dwFlags
);
194 HRESULT WINAPI
IDirectMusicSignPostTrack_Compose (LPDIRECTMUSICTRACK8 iface
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
)
196 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
198 FIXME("(%p, %p, %ld, %p): stub\n", This
, pContext
, dwTrackGroup
, ppResultTrack
);
203 HRESULT WINAPI
IDirectMusicSignPostTrack_Join (LPDIRECTMUSICTRACK8 iface
, IDirectMusicTrack
* pNewTrack
, MUSIC_TIME mtJoin
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
)
205 ICOM_THIS(IDirectMusicSignPostTrack
,iface
);
207 FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This
, pNewTrack
, mtJoin
, pContext
, dwTrackGroup
, ppResultTrack
);
212 ICOM_VTABLE(IDirectMusicTrack8
) DirectMusicSignPostTrack_Vtbl
=
214 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
215 IDirectMusicSignPostTrack_QueryInterface
,
216 IDirectMusicSignPostTrack_AddRef
,
217 IDirectMusicSignPostTrack_Release
,
218 IDirectMusicSignPostTrack_Init
,
219 IDirectMusicSignPostTrack_InitPlay
,
220 IDirectMusicSignPostTrack_EndPlay
,
221 IDirectMusicSignPostTrack_Play
,
222 IDirectMusicSignPostTrack_GetParam
,
223 IDirectMusicSignPostTrack_SetParam
,
224 IDirectMusicSignPostTrack_IsParamSupported
,
225 IDirectMusicSignPostTrack_AddNotificationType
,
226 IDirectMusicSignPostTrack_RemoveNotificationType
,
227 IDirectMusicSignPostTrack_Clone
,
228 IDirectMusicSignPostTrack_PlayEx
,
229 IDirectMusicSignPostTrack_GetParamEx
,
230 IDirectMusicSignPostTrack_SetParamEx
,
231 IDirectMusicSignPostTrack_Compose
,
232 IDirectMusicSignPostTrack_Join
235 /* for ClassFactory */
236 HRESULT WINAPI
DMUSIC_CreateDirectMusicSignPostTrack (LPCGUID lpcGUID
, LPDIRECTMUSICTRACK8
*ppTrack
, LPUNKNOWN pUnkOuter
)
238 IDirectMusicSignPostTrack
* track
;
240 if (IsEqualIID (lpcGUID
, &IID_IDirectMusicTrack
)
241 || IsEqualIID (lpcGUID
, &IID_IDirectMusicTrack8
)) {
242 track
= HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicSignPostTrack
));
244 *ppTrack
= (LPDIRECTMUSICTRACK8
) NULL
;
245 return E_OUTOFMEMORY
;
247 track
->lpVtbl
= &DirectMusicSignPostTrack_Vtbl
;
249 track
->pStream
= HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicSignPostTrackStream
));
250 track
->pStream
->lpVtbl
= &DirectMusicSignPostTrackStream_Vtbl
;
251 track
->pStream
->ref
= 1;
252 track
->pStream
->pParentTrack
= track
;
253 *ppTrack
= (LPDIRECTMUSICTRACK8
) track
;
257 WARN("No interface found\n");
258 return E_NOINTERFACE
;
262 /*****************************************************************************
263 * IDirectMusicSignPostTrackStream implementation
265 /* IDirectMusicSignPostTrackStream IUnknown part follow: */
266 HRESULT WINAPI
IDirectMusicSignPostTrackStream_QueryInterface (LPPERSISTSTREAM iface
, REFIID riid
, LPVOID
*ppobj
)
268 ICOM_THIS(IDirectMusicSignPostTrackStream
,iface
);
270 if (IsEqualIID (riid
, &IID_IUnknown
)
271 || IsEqualIID (riid
, &IID_IPersistStream
)) {
272 IDirectMusicSignPostTrackStream_AddRef(iface
);
277 WARN("(%p)->(%s,%p),not found\n",This
,debugstr_guid(riid
),ppobj
);
278 return E_NOINTERFACE
;
281 ULONG WINAPI
IDirectMusicSignPostTrackStream_AddRef (LPPERSISTSTREAM iface
)
283 ICOM_THIS(IDirectMusicSignPostTrackStream
,iface
);
284 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
285 return ++(This
->ref
);
288 ULONG WINAPI
IDirectMusicSignPostTrackStream_Release (LPPERSISTSTREAM iface
)
290 ICOM_THIS(IDirectMusicSignPostTrackStream
,iface
);
291 ULONG ref
= --This
->ref
;
292 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
294 HeapFree(GetProcessHeap(), 0, This
);
299 /* IDirectMusicSignPostTrackStream IPersist part: */
300 HRESULT WINAPI
IDirectMusicSignPostTrackStream_GetClassID (LPPERSISTSTREAM iface
, CLSID
* pClassID
)
305 /* IDirectMusicSignPostTrackStream IPersistStream part: */
306 HRESULT WINAPI
IDirectMusicSignPostTrackStream_IsDirty (LPPERSISTSTREAM iface
)
311 HRESULT WINAPI
IDirectMusicSignPostTrackStream_Load (LPPERSISTSTREAM iface
, IStream
* pStm
)
313 FIXME(": Loading not implemented yet\n");
317 HRESULT WINAPI
IDirectMusicSignPostTrackStream_Save (LPPERSISTSTREAM iface
, IStream
* pStm
, BOOL fClearDirty
)
322 HRESULT WINAPI
IDirectMusicSignPostTrackStream_GetSizeMax (LPPERSISTSTREAM iface
, ULARGE_INTEGER
* pcbSize
)
327 ICOM_VTABLE(IPersistStream
) DirectMusicSignPostTrackStream_Vtbl
=
329 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
330 IDirectMusicSignPostTrackStream_QueryInterface
,
331 IDirectMusicSignPostTrackStream_AddRef
,
332 IDirectMusicSignPostTrackStream_Release
,
333 IDirectMusicSignPostTrackStream_GetClassID
,
334 IDirectMusicSignPostTrackStream_IsDirty
,
335 IDirectMusicSignPostTrackStream_Load
,
336 IDirectMusicSignPostTrackStream_Save
,
337 IDirectMusicSignPostTrackStream_GetSizeMax