1 /* IDirectMusicTempoTrack 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 * IDirectMusicTempoTrack implementation
36 /* IDirectMusicTempoTrack IUnknown part: */
37 HRESULT WINAPI
IDirectMusicTempoTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface
, REFIID riid
, LPVOID
*ppobj
)
39 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
41 if (IsEqualIID (riid
, &IID_IUnknown
) ||
42 IsEqualIID (riid
, &IID_IDirectMusicTrack
) ||
43 IsEqualIID (riid
, &IID_IDirectMusicTrack8
)) {
44 IDirectMusicTempoTrack_AddRef(iface
);
47 } else if (IsEqualIID (riid
, &IID_IPersistStream
)) {
48 IDirectMusicTempoTrackStream_AddRef ((LPPERSISTSTREAM
)This
->pStream
);
49 *ppobj
= This
->pStream
;
53 WARN("(%p)->(%s,%p),not found\n", This
, debugstr_guid(riid
), ppobj
);
57 ULONG WINAPI
IDirectMusicTempoTrack_AddRef (LPDIRECTMUSICTRACK8 iface
)
59 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
60 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
64 ULONG WINAPI
IDirectMusicTempoTrack_Release (LPDIRECTMUSICTRACK8 iface
)
66 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
67 ULONG ref
= --This
->ref
;
68 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
70 HeapFree(GetProcessHeap(), 0, This
);
75 /* IDirectMusicTempoTrack IDirectMusicTrack part: */
76 HRESULT WINAPI
IDirectMusicTempoTrack_Init (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegment
* pSegment
)
78 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
80 FIXME("(%p, %p): stub\n", This
, pSegment
);
85 HRESULT WINAPI
IDirectMusicTempoTrack_InitPlay (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegmentState
* pSegmentState
, IDirectMusicPerformance
* pPerformance
, void** ppStateData
, DWORD dwVirtualTrack8ID
, DWORD dwFlags
)
87 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
89 FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This
, pSegmentState
, pPerformance
, ppStateData
, dwVirtualTrack8ID
, dwFlags
);
94 HRESULT WINAPI
IDirectMusicTempoTrack_EndPlay (LPDIRECTMUSICTRACK8 iface
, void* pStateData
)
96 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
98 FIXME("(%p, %p): stub\n", This
, pStateData
);
103 HRESULT WINAPI
IDirectMusicTempoTrack_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(IDirectMusicTempoTrack
,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
IDirectMusicTempoTrack_GetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, MUSIC_TIME
* pmtNext
, void* pParam
)
114 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
116 FIXME("(%p, %s, %ld, %p, %p): stub\n", This
, debugstr_guid(rguidType
), mtTime
, pmtNext
, pParam
);
121 HRESULT WINAPI
IDirectMusicTempoTrack_SetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, void* pParam
)
123 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
125 FIXME("(%p, %s, %ld, %p): stub\n", This
, debugstr_guid(rguidType
), mtTime
, pParam
);
130 HRESULT WINAPI
IDirectMusicTempoTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
)
132 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
134 TRACE("(%p, %s): ", This
, debugstr_guid(rguidType
));
135 if (IsEqualGUID (rguidType
, &GUID_DisableTempo
)
136 || IsEqualGUID (rguidType
, &GUID_EnableTempo
)
137 || IsEqualGUID (rguidType
, &GUID_TempoParam
)) {
138 TRACE("param supported\n");
142 TRACE("param unsupported\n");
143 return DMUS_E_TYPE_UNSUPPORTED
;
146 HRESULT WINAPI
IDirectMusicTempoTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
)
148 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
150 FIXME("(%p, %s): stub\n", This
, debugstr_guid(rguidNotificationType
));
155 HRESULT WINAPI
IDirectMusicTempoTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
)
157 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
159 FIXME("(%p, %s): stub\n", This
, debugstr_guid(rguidNotificationType
));
164 HRESULT WINAPI
IDirectMusicTempoTrack_Clone (LPDIRECTMUSICTRACK8 iface
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, IDirectMusicTrack
** ppTrack
)
166 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
168 FIXME("(%p, %ld, %ld, %p): stub\n", This
, mtStart
, mtEnd
, ppTrack
);
173 /* IDirectMusicTempoTrack IDirectMusicTrack8 part: */
174 HRESULT WINAPI
IDirectMusicTempoTrack_PlayEx (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, REFERENCE_TIME rtStart
, REFERENCE_TIME rtEnd
, REFERENCE_TIME rtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
)
176 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
178 FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This
, pStateData
, rtStart
, rtEnd
, rtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
183 HRESULT WINAPI
IDirectMusicTempoTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, REFERENCE_TIME
* prtNext
, void* pParam
, void* pStateData
, DWORD dwFlags
)
185 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
187 FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This
, debugstr_guid(rguidType
), rtTime
, prtNext
, pParam
, pStateData
, dwFlags
);
192 HRESULT WINAPI
IDirectMusicTempoTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, void* pParam
, void* pStateData
, DWORD dwFlags
)
194 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
196 FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This
, debugstr_guid(rguidType
), rtTime
, pParam
, pStateData
, dwFlags
);
201 HRESULT WINAPI
IDirectMusicTempoTrack_Compose (LPDIRECTMUSICTRACK8 iface
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
)
203 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
205 FIXME("(%p, %p, %ld, %p): stub\n", This
, pContext
, dwTrackGroup
, ppResultTrack
);
210 HRESULT WINAPI
IDirectMusicTempoTrack_Join (LPDIRECTMUSICTRACK8 iface
, IDirectMusicTrack
* pNewTrack
, MUSIC_TIME mtJoin
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
)
212 ICOM_THIS(IDirectMusicTempoTrack
,iface
);
214 FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This
, pNewTrack
, mtJoin
, pContext
, dwTrackGroup
, ppResultTrack
);
219 ICOM_VTABLE(IDirectMusicTrack8
) DirectMusicTempoTrack_Vtbl
=
221 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
222 IDirectMusicTempoTrack_QueryInterface
,
223 IDirectMusicTempoTrack_AddRef
,
224 IDirectMusicTempoTrack_Release
,
225 IDirectMusicTempoTrack_Init
,
226 IDirectMusicTempoTrack_InitPlay
,
227 IDirectMusicTempoTrack_EndPlay
,
228 IDirectMusicTempoTrack_Play
,
229 IDirectMusicTempoTrack_GetParam
,
230 IDirectMusicTempoTrack_SetParam
,
231 IDirectMusicTempoTrack_IsParamSupported
,
232 IDirectMusicTempoTrack_AddNotificationType
,
233 IDirectMusicTempoTrack_RemoveNotificationType
,
234 IDirectMusicTempoTrack_Clone
,
235 IDirectMusicTempoTrack_PlayEx
,
236 IDirectMusicTempoTrack_GetParamEx
,
237 IDirectMusicTempoTrack_SetParamEx
,
238 IDirectMusicTempoTrack_Compose
,
239 IDirectMusicTempoTrack_Join
242 /* for ClassFactory */
243 HRESULT WINAPI
DMUSIC_CreateDirectMusicTempoTrack (LPCGUID lpcGUID
, LPDIRECTMUSICTRACK8
*ppTrack
, LPUNKNOWN pUnkOuter
)
245 IDirectMusicTempoTrack
* track
;
247 if (IsEqualIID (lpcGUID
, &IID_IDirectMusicTrack
)
248 || IsEqualIID (lpcGUID
, &IID_IDirectMusicTrack8
)) {
249 track
= HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicTempoTrack
));
251 *ppTrack
= (LPDIRECTMUSICTRACK8
) NULL
;
252 return E_OUTOFMEMORY
;
254 track
->lpVtbl
= &DirectMusicTempoTrack_Vtbl
;
256 track
->pStream
= HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicTempoTrackStream
));
257 track
->pStream
->lpVtbl
= &DirectMusicTempoTrackStream_Vtbl
;
258 track
->pStream
->ref
= 1;
259 track
->pStream
->pParentTrack
= track
;
260 *ppTrack
= (LPDIRECTMUSICTRACK8
) track
;
263 WARN("No interface found\n");
265 return E_NOINTERFACE
;
269 /*****************************************************************************
270 * IDirectMusicTempoTrackStream implementation
272 /* IDirectMusicTempoTrackStream IUnknown part follow: */
273 HRESULT WINAPI
IDirectMusicTempoTrackStream_QueryInterface (LPPERSISTSTREAM iface
, REFIID riid
, LPVOID
*ppobj
)
275 ICOM_THIS(IDirectMusicTempoTrackStream
,iface
);
277 if (IsEqualIID (riid
, &IID_IUnknown
)
278 || IsEqualIID (riid
, &IID_IPersistStream
)) {
279 IDirectMusicTempoTrackStream_AddRef(iface
);
283 WARN("(%p)->(%s,%p),not found\n", This
, debugstr_guid(riid
),ppobj
);
284 return E_NOINTERFACE
;
287 ULONG WINAPI
IDirectMusicTempoTrackStream_AddRef (LPPERSISTSTREAM iface
)
289 ICOM_THIS(IDirectMusicTempoTrackStream
,iface
);
290 TRACE("(%p) : AddRef from %ld\n", This
, This
->ref
);
291 return ++(This
->ref
);
294 ULONG WINAPI
IDirectMusicTempoTrackStream_Release (LPPERSISTSTREAM iface
)
296 ICOM_THIS(IDirectMusicTempoTrackStream
,iface
);
297 ULONG ref
= --This
->ref
;
298 TRACE("(%p) : ReleaseRef to %ld\n", This
, This
->ref
);
300 HeapFree(GetProcessHeap(), 0, This
);
305 /* IDirectMusicTempoTrackStream IPersist part: */
306 HRESULT WINAPI
IDirectMusicTempoTrackStream_GetClassID (LPPERSISTSTREAM iface
, CLSID
* pClassID
)
311 /* IDirectMusicTempoTrackStream IPersistStream part: */
312 HRESULT WINAPI
IDirectMusicTempoTrackStream_IsDirty (LPPERSISTSTREAM iface
)
317 HRESULT WINAPI
IDirectMusicTempoTrackStream_Load (LPPERSISTSTREAM iface
, IStream
* pStm
)
319 FIXME(": Loading not implemented yet\n");
323 HRESULT WINAPI
IDirectMusicTempoTrackStream_Save (LPPERSISTSTREAM iface
, IStream
* pStm
, BOOL fClearDirty
)
328 HRESULT WINAPI
IDirectMusicTempoTrackStream_GetSizeMax (LPPERSISTSTREAM iface
, ULARGE_INTEGER
* pcbSize
)
333 ICOM_VTABLE(IPersistStream
) DirectMusicTempoTrackStream_Vtbl
=
335 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
336 IDirectMusicTempoTrackStream_QueryInterface
,
337 IDirectMusicTempoTrackStream_AddRef
,
338 IDirectMusicTempoTrackStream_Release
,
339 IDirectMusicTempoTrackStream_GetClassID
,
340 IDirectMusicTempoTrackStream_IsDirty
,
341 IDirectMusicTempoTrackStream_Load
,
342 IDirectMusicTempoTrackStream_Save
,
343 IDirectMusicTempoTrackStream_GetSizeMax