1 /* IDirectMusicTempoTrack Implementation
3 * Copyright (C) 2003-2004 Rok Mandeljc
4 * Copyright (C) 2004 Raphael Junqueira
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Library General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #include "dmime_private.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(dmime
);
24 WINE_DECLARE_DEBUG_CHANNEL(dmfile
);
26 /*****************************************************************************
27 * IDirectMusicTempoTrack implementation
29 /* IDirectMusicTempoTrack IUnknown part: */
30 HRESULT WINAPI
IDirectMusicTempoTrack_IUnknown_QueryInterface (LPUNKNOWN iface
, REFIID riid
, LPVOID
*ppobj
) {
31 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, UnknownVtbl
, iface
);
32 TRACE("(%p, %s, %p)\n", This
, debugstr_dmguid(riid
), ppobj
);
34 if (IsEqualIID (riid
, &IID_IUnknown
)) {
35 *ppobj
= (LPUNKNOWN
)&This
->UnknownVtbl
;
36 IDirectMusicTempoTrack_IUnknown_AddRef ((LPUNKNOWN
)&This
->UnknownVtbl
);
38 } else if (IsEqualIID (riid
, &IID_IDirectMusicTrack
)
39 || IsEqualIID (riid
, &IID_IDirectMusicTrack8
)) {
40 *ppobj
= (LPDIRECTMUSICTRACK8
)&This
->TrackVtbl
;
41 IDirectMusicTempoTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8
)&This
->TrackVtbl
);
43 } else if (IsEqualIID (riid
, &IID_IPersistStream
)) {
44 *ppobj
= (LPPERSISTSTREAM
)&This
->PersistStreamVtbl
;
45 IDirectMusicTempoTrack_IPersistStream_AddRef ((LPPERSISTSTREAM
)&This
->PersistStreamVtbl
);
49 WARN("(%p, %s, %p): not found\n", This
, debugstr_dmguid(riid
), ppobj
);
53 ULONG WINAPI
IDirectMusicTempoTrack_IUnknown_AddRef (LPUNKNOWN iface
) {
54 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, UnknownVtbl
, iface
);
55 TRACE("(%p): AddRef from %ld\n", This
, This
->ref
);
59 ULONG WINAPI
IDirectMusicTempoTrack_IUnknown_Release (LPUNKNOWN iface
) {
60 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, UnknownVtbl
, iface
);
61 ULONG ref
= --This
->ref
;
62 TRACE("(%p): ReleaseRef to %ld\n", This
, This
->ref
);
64 HeapFree(GetProcessHeap(), 0, This
);
69 IUnknownVtbl DirectMusicTempoTrack_Unknown_Vtbl
= {
70 IDirectMusicTempoTrack_IUnknown_QueryInterface
,
71 IDirectMusicTempoTrack_IUnknown_AddRef
,
72 IDirectMusicTempoTrack_IUnknown_Release
75 /* IDirectMusicTempoTrack IDirectMusicTrack8 part: */
76 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface
, REFIID riid
, LPVOID
*ppobj
) {
77 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
78 return IDirectMusicTempoTrack_IUnknown_QueryInterface ((LPUNKNOWN
)&This
->UnknownVtbl
, riid
, ppobj
);
81 ULONG WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface
) {
82 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
83 return IDirectMusicTempoTrack_IUnknown_AddRef ((LPUNKNOWN
)&This
->UnknownVtbl
);
86 ULONG WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface
) {
87 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
88 return IDirectMusicTempoTrack_IUnknown_Release ((LPUNKNOWN
)&This
->UnknownVtbl
);
91 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegment
* pSegment
)
93 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
94 TRACE("(%p, %p): nothing to do here\n", This
, pSegment
);
98 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface
, IDirectMusicSegmentState
* pSegmentState
, IDirectMusicPerformance
* pPerformance
, void** ppStateData
, DWORD dwVirtualTrack8ID
, DWORD dwFlags
)
100 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
102 LPDMUS_PRIVATE_TEMPO_PLAY_STATE pState
= NULL
;
104 FIXME("(%p, %p, %p, %p, %ld, %ld): semi-stub\n", This
, pSegmentState
, pPerformance
, ppStateData
, dwVirtualTrack8ID
, dwFlags
);
106 pState
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(DMUS_PRIVATE_TEMPO_PLAY_STATE
));
107 if (NULL
== pState
) {
108 ERR(": no more memory\n");
109 return E_OUTOFMEMORY
;
111 /** TODO real fill usefull datas */
113 *ppStateData
= pState
;
117 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface
, void* pStateData
)
119 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
121 LPDMUS_PRIVATE_TEMPO_PLAY_STATE pState
= pStateData
;
123 FIXME("(%p, %p): semi-stub\n", This
, pStateData
);
125 if (NULL
== pStateData
) {
128 /** TODO real clean up */
129 HeapFree(GetProcessHeap(), 0, pState
);
133 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, MUSIC_TIME mtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
)
135 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
136 FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This
, pStateData
, mtStart
, mtEnd
, mtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
137 /** should use IDirectMusicPerformance_SendPMsg here */
141 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, MUSIC_TIME
* pmtNext
, void* pParam
) {
142 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
145 struct list
* pEntry
= NULL
;
146 LPDMUS_PRIVATE_TEMPO_ITEM pIt
= NULL
;
147 DMUS_TEMPO_PARAM
* prm
= pParam
;
149 FIXME("(%p, %s, %ld, %p, %p): almost stub\n", This
, debugstr_dmguid(rguidType
), mtTime
, pmtNext
, pParam
);
151 if (NULL
== pParam
) {
155 hr
= IDirectMusicTempoTrack_IDirectMusicTrack_IsParamSupported (iface
, rguidType
);
159 if (FALSE
== This
->enabled
) {
160 return DMUS_E_TYPE_DISABLED
;
163 if (NULL
!= pmtNext
) *pmtNext
= 0;
165 prm
->dblTempo
= 0.123456;
167 LIST_FOR_EACH (pEntry
, &This
->Items
) {
168 pIt
= LIST_ENTRY(pEntry
, DMUS_PRIVATE_TEMPO_ITEM
, entry
);
169 /*TRACE(" - %p -> 0x%lx,%p\n", pIt, pIt->item.lTime, pIt->item.dblTempo);*/
170 if (pIt
->item
.lTime
<= mtTime
) {
171 MUSIC_TIME ofs
= pIt
->item
.lTime
- mtTime
;
172 if (ofs
> prm
->mtTime
) {
174 prm
->dblTempo
= pIt
->item
.dblTempo
;
176 if (NULL
!= pmtNext
&& pIt
->item
.lTime
> mtTime
) {
177 if (pIt
->item
.lTime
< *pmtNext
) {
178 *pmtNext
= pIt
->item
.lTime
;
184 if (0.123456 == prm
->dblTempo
) {
185 return DMUS_E_NOT_FOUND
;
190 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, MUSIC_TIME mtTime
, void* pParam
) {
191 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
192 FIXME("(%p, %s, %ld, %p): stub\n", This
, debugstr_dmguid(rguidType
), mtTime
, pParam
);
196 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
) {
197 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
199 TRACE("(%p, %s): ", This
, debugstr_dmguid(rguidType
));
200 if (IsEqualGUID (rguidType
, &GUID_DisableTempo
)
201 || IsEqualGUID (rguidType
, &GUID_EnableTempo
)
202 || IsEqualGUID (rguidType
, &GUID_TempoParam
)) {
203 TRACE("param supported\n");
206 if (FALSE
== This
->enabled
) {
207 return DMUS_E_TYPE_DISABLED
;
209 TRACE("param unsupported\n");
210 return DMUS_E_TYPE_UNSUPPORTED
;
213 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
) {
214 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
215 FIXME("(%p, %s): stub\n", This
, debugstr_dmguid(rguidNotificationType
));
219 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidNotificationType
) {
220 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
221 FIXME("(%p, %s): stub\n", This
, debugstr_dmguid(rguidNotificationType
));
225 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface
, MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, IDirectMusicTrack
** ppTrack
) {
226 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
227 FIXME("(%p, %ld, %ld, %p): stub\n", This
, mtStart
, mtEnd
, ppTrack
);
231 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface
, void* pStateData
, REFERENCE_TIME rtStart
, REFERENCE_TIME rtEnd
, REFERENCE_TIME rtOffset
, DWORD dwFlags
, IDirectMusicPerformance
* pPerf
, IDirectMusicSegmentState
* pSegSt
, DWORD dwVirtualID
) {
232 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
233 FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This
, pStateData
, rtStart
, rtEnd
, rtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
237 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, REFERENCE_TIME
* prtNext
, void* pParam
, void* pStateData
, DWORD dwFlags
) {
238 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
239 FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This
, debugstr_dmguid(rguidType
), rtTime
, prtNext
, pParam
, pStateData
, dwFlags
);
243 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface
, REFGUID rguidType
, REFERENCE_TIME rtTime
, void* pParam
, void* pStateData
, DWORD dwFlags
) {
244 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
245 FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This
, debugstr_dmguid(rguidType
), rtTime
, pParam
, pStateData
, dwFlags
);
249 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
) {
250 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
251 FIXME("(%p, %p, %ld, %p): stub\n", This
, pContext
, dwTrackGroup
, ppResultTrack
);
255 HRESULT WINAPI
IDirectMusicTempoTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface
, IDirectMusicTrack
* pNewTrack
, MUSIC_TIME mtJoin
, IUnknown
* pContext
, DWORD dwTrackGroup
, IDirectMusicTrack
** ppResultTrack
) {
256 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, TrackVtbl
, iface
);
257 FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This
, pNewTrack
, mtJoin
, pContext
, dwTrackGroup
, ppResultTrack
);
261 IDirectMusicTrack8Vtbl DirectMusicTempoTrack_Track_Vtbl
= {
262 IDirectMusicTempoTrack_IDirectMusicTrack_QueryInterface
,
263 IDirectMusicTempoTrack_IDirectMusicTrack_AddRef
,
264 IDirectMusicTempoTrack_IDirectMusicTrack_Release
,
265 IDirectMusicTempoTrack_IDirectMusicTrack_Init
,
266 IDirectMusicTempoTrack_IDirectMusicTrack_InitPlay
,
267 IDirectMusicTempoTrack_IDirectMusicTrack_EndPlay
,
268 IDirectMusicTempoTrack_IDirectMusicTrack_Play
,
269 IDirectMusicTempoTrack_IDirectMusicTrack_GetParam
,
270 IDirectMusicTempoTrack_IDirectMusicTrack_SetParam
,
271 IDirectMusicTempoTrack_IDirectMusicTrack_IsParamSupported
,
272 IDirectMusicTempoTrack_IDirectMusicTrack_AddNotificationType
,
273 IDirectMusicTempoTrack_IDirectMusicTrack_RemoveNotificationType
,
274 IDirectMusicTempoTrack_IDirectMusicTrack_Clone
,
275 IDirectMusicTempoTrack_IDirectMusicTrack_PlayEx
,
276 IDirectMusicTempoTrack_IDirectMusicTrack_GetParamEx
,
277 IDirectMusicTempoTrack_IDirectMusicTrack_SetParamEx
,
278 IDirectMusicTempoTrack_IDirectMusicTrack_Compose
,
279 IDirectMusicTempoTrack_IDirectMusicTrack_Join
282 /* IDirectMusicTempoTrack IPersistStream part: */
283 HRESULT WINAPI
IDirectMusicTempoTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface
, REFIID riid
, LPVOID
*ppobj
) {
284 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, PersistStreamVtbl
, iface
);
285 return IDirectMusicTempoTrack_IUnknown_QueryInterface ((LPUNKNOWN
)&This
->UnknownVtbl
, riid
, ppobj
);
288 ULONG WINAPI
IDirectMusicTempoTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface
) {
289 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, PersistStreamVtbl
, iface
);
290 return IDirectMusicTempoTrack_IUnknown_AddRef ((LPUNKNOWN
)&This
->UnknownVtbl
);
293 ULONG WINAPI
IDirectMusicTempoTrack_IPersistStream_Release (LPPERSISTSTREAM iface
) {
294 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, PersistStreamVtbl
, iface
);
295 return IDirectMusicTempoTrack_IUnknown_Release ((LPUNKNOWN
)&This
->UnknownVtbl
);
298 HRESULT WINAPI
IDirectMusicTempoTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface
, CLSID
* pClassID
) {
299 ICOM_THIS_MULTI(IDirectMusicSegment8Impl
, PersistStreamVtbl
, iface
);
300 TRACE("(%p, %p)\n", This
, pClassID
);
301 memcpy(pClassID
, &CLSID_DirectMusicTempoTrack
, sizeof(CLSID
));
305 HRESULT WINAPI
IDirectMusicTempoTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface
) {
306 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, PersistStreamVtbl
, iface
);
307 FIXME("(%p): stub, always S_FALSE\n", This
);
311 HRESULT WINAPI
IDirectMusicTempoTrack_IPersistStream_Load (LPPERSISTSTREAM iface
, IStream
* pStm
) {
312 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, PersistStreamVtbl
, iface
);
313 DMUS_PRIVATE_CHUNK Chunk
;
314 DWORD StreamSize
, StreamCount
;
315 LARGE_INTEGER liMove
;
316 DMUS_IO_TEMPO_ITEM item
;
317 LPDMUS_PRIVATE_TEMPO_ITEM pNewItem
= NULL
;
319 FIXME("(%p, %p): Loading not fully implemented yet\n", This
, pStm
);
322 IStream_Read (pStm
, &Chunk
, sizeof(FOURCC
)+sizeof(DWORD
), NULL
);
323 TRACE_(dmfile
)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk
.fccID
), Chunk
.dwSize
);
324 switch (Chunk
.fccID
) {
325 case DMUS_FOURCC_TEMPO_TRACK
: {
326 TRACE_(dmfile
)(": Tempo track\n");
328 IStream_Read (pStm
, &StreamSize
, sizeof(DWORD
), NULL
);
329 StreamSize
-= sizeof(DWORD
);
331 TRACE_(dmfile
)(" - sizeof(DMUS_IO_TEMPO_ITEM): %lu (chunkSize = %lu)\n", StreamSize
, Chunk
.dwSize
- sizeof(DWORD
));
333 IStream_Read (pStm
, &item
, sizeof(item
), NULL
);
335 TRACE_(dmfile
)("DMUS_IO_TEMPO_ITEM #%ld\n", nItem
);
336 TRACE_(dmfile
)(" - lTime = %lu\n", item
.lTime
);
337 TRACE_(dmfile
)(" - dblTempo = %g\n", item
.dblTempo
);
338 pNewItem
= HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY
, sizeof(DMUS_PRIVATE_TEMPO_ITEM
));
339 if (NULL
== pNewItem
) {
340 ERR(": no more memory\n");
341 return E_OUTOFMEMORY
;
343 memcpy(&pNewItem
->item
, &item
, sizeof(DMUS_IO_TEMPO_ITEM
));
344 list_add_tail (&This
->Items
, &pNewItem
->entry
);
346 StreamCount
+= sizeof(item
);
347 TRACE_(dmfile
)(": StreamCount[0] = %ld < StreamSize[0] = %ld\n", StreamCount
, StreamSize
);
348 } while (StreamCount
< StreamSize
);
350 liMove
.QuadPart
= Chunk
.dwSize
;
351 IStream_Seek (pStm
, liMove
, STREAM_SEEK_CUR
, NULL
);
356 TRACE_(dmfile
)(": unexpected chunk; loading failed)\n");
357 liMove
.QuadPart
= Chunk
.dwSize
;
358 IStream_Seek (pStm
, liMove
, STREAM_SEEK_CUR
, NULL
);
367 HRESULT WINAPI
IDirectMusicTempoTrack_IPersistStream_Save (LPPERSISTSTREAM iface
, IStream
* pStm
, BOOL fClearDirty
) {
368 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, PersistStreamVtbl
, iface
);
369 FIXME("(%p): Saving not implemented yet\n", This
);
373 HRESULT WINAPI
IDirectMusicTempoTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface
, ULARGE_INTEGER
* pcbSize
) {
374 ICOM_THIS_MULTI(IDirectMusicTempoTrack
, PersistStreamVtbl
, iface
);
375 FIXME("(%p, %p): stub\n", This
, pcbSize
);
379 IPersistStreamVtbl DirectMusicTempoTrack_PersistStream_Vtbl
= {
380 IDirectMusicTempoTrack_IPersistStream_QueryInterface
,
381 IDirectMusicTempoTrack_IPersistStream_AddRef
,
382 IDirectMusicTempoTrack_IPersistStream_Release
,
383 IDirectMusicTempoTrack_IPersistStream_GetClassID
,
384 IDirectMusicTempoTrack_IPersistStream_IsDirty
,
385 IDirectMusicTempoTrack_IPersistStream_Load
,
386 IDirectMusicTempoTrack_IPersistStream_Save
,
387 IDirectMusicTempoTrack_IPersistStream_GetSizeMax
390 /* for ClassFactory */
391 HRESULT WINAPI
DMUSIC_CreateDirectMusicTempoTrack (LPCGUID lpcGUID
, LPVOID
*ppobj
, LPUNKNOWN pUnkOuter
) {
392 IDirectMusicTempoTrack
* track
;
394 track
= HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(IDirectMusicTempoTrack
));
396 *ppobj
= (LPVOID
) NULL
;
397 return E_OUTOFMEMORY
;
399 track
->UnknownVtbl
= &DirectMusicTempoTrack_Unknown_Vtbl
;
400 track
->TrackVtbl
= &DirectMusicTempoTrack_Track_Vtbl
;
401 track
->PersistStreamVtbl
= &DirectMusicTempoTrack_PersistStream_Vtbl
;
402 track
->pDesc
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(DMUS_OBJECTDESC
));
403 DM_STRUCT_INIT(track
->pDesc
);
404 track
->pDesc
->dwValidData
|= DMUS_OBJ_CLASS
;
405 memcpy (&track
->pDesc
->guidClass
, &CLSID_DirectMusicTempoTrack
, sizeof (CLSID
));
406 track
->ref
= 0; /* will be inited by QueryInterface */
407 track
->enabled
= TRUE
;
408 list_init (&track
->Items
);
410 return IDirectMusicTempoTrack_IUnknown_QueryInterface ((LPUNKNOWN
)&track
->UnknownVtbl
, lpcGUID
, ppobj
);