1 /* IDirectMusicSegTriggerTrack Implementation
3 * Copyright (C) 2003-2004 Rok Mandeljc
4 * Copyright (C) 2003-2004 Raphael Junqueira
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (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 GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "dmime_private.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(dmime
);
25 WINE_DECLARE_DEBUG_CHANNEL(dmfile
);
27 /*****************************************************************************
28 * IDirectMusicSegTriggerTrack implementation
30 typedef struct IDirectMusicSegTriggerTrack
{
31 IDirectMusicTrack8 IDirectMusicTrack8_iface
;
32 struct dmobject dmobj
;/* IPersistStream only */
35 } IDirectMusicSegTriggerTrack
;
37 /* IDirectMusicSegTriggerTrack IDirectMusicTrack8 part: */
38 static inline IDirectMusicSegTriggerTrack
*impl_from_IDirectMusicTrack8(IDirectMusicTrack8
*iface
)
40 return CONTAINING_RECORD(iface
, IDirectMusicSegTriggerTrack
, IDirectMusicTrack8_iface
);
43 static HRESULT WINAPI
IDirectMusicTrack8Impl_QueryInterface(IDirectMusicTrack8
*iface
, REFIID riid
,
46 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
48 TRACE("(%p, %s, %p)\n", This
, debugstr_dmguid(riid
), ret_iface
);
52 if (IsEqualIID(riid
, &IID_IUnknown
) || IsEqualIID(riid
, &IID_IDirectMusicTrack
) ||
53 IsEqualIID(riid
, &IID_IDirectMusicTrack8
))
55 else if (IsEqualIID(riid
, &IID_IPersistStream
))
56 *ret_iface
= &This
->dmobj
.IPersistStream_iface
;
58 WARN("(%p, %s, %p): not found\n", This
, debugstr_dmguid(riid
), ret_iface
);
62 IUnknown_AddRef((IUnknown
*)*ret_iface
);
66 static ULONG WINAPI
IDirectMusicTrack8Impl_AddRef(IDirectMusicTrack8
*iface
)
68 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
69 LONG ref
= InterlockedIncrement(&This
->ref
);
71 TRACE("(%p) ref=%d\n", This
, ref
);
76 static ULONG WINAPI
IDirectMusicTrack8Impl_Release(IDirectMusicTrack8
*iface
)
78 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
79 LONG ref
= InterlockedDecrement(&This
->ref
);
81 TRACE("(%p) ref=%d\n", This
, ref
);
84 HeapFree(GetProcessHeap(), 0, This
);
91 static HRESULT WINAPI
IDirectMusicTrack8Impl_Init(IDirectMusicTrack8
*iface
,
92 IDirectMusicSegment
*pSegment
)
94 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
95 FIXME("(%p, %p): stub\n", This
, pSegment
);
99 static HRESULT WINAPI
IDirectMusicTrack8Impl_InitPlay(IDirectMusicTrack8
*iface
,
100 IDirectMusicSegmentState
*pSegmentState
, IDirectMusicPerformance
*pPerformance
,
101 void **ppStateData
, DWORD dwVirtualTrack8ID
, DWORD dwFlags
)
103 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
104 FIXME("(%p, %p, %p, %p, %d, %d): stub\n", This
, pSegmentState
, pPerformance
, ppStateData
, dwVirtualTrack8ID
, dwFlags
);
108 static HRESULT WINAPI
IDirectMusicTrack8Impl_EndPlay(IDirectMusicTrack8
*iface
, void *pStateData
)
110 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
111 FIXME("(%p, %p): stub\n", This
, pStateData
);
115 static HRESULT WINAPI
IDirectMusicTrack8Impl_Play(IDirectMusicTrack8
*iface
, void *pStateData
,
116 MUSIC_TIME mtStart
, MUSIC_TIME mtEnd
, MUSIC_TIME mtOffset
, DWORD dwFlags
,
117 IDirectMusicPerformance
*pPerf
, IDirectMusicSegmentState
*pSegSt
, DWORD dwVirtualID
)
119 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
120 FIXME("(%p, %p, %d, %d, %d, %d, %p, %p, %d): stub\n", This
, pStateData
, mtStart
, mtEnd
, mtOffset
, dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
124 static HRESULT WINAPI
IDirectMusicTrack8Impl_GetParam(IDirectMusicTrack8
*iface
, REFGUID rguidType
,
125 MUSIC_TIME mtTime
, MUSIC_TIME
*pmtNext
, void *pParam
)
127 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
128 FIXME("(%p, %s, %d, %p, %p): stub\n", This
, debugstr_dmguid(rguidType
), mtTime
, pmtNext
, pParam
);
132 static HRESULT WINAPI
IDirectMusicTrack8Impl_SetParam(IDirectMusicTrack8
*iface
, REFGUID rguidType
,
133 MUSIC_TIME mtTime
, void *pParam
)
135 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
136 FIXME("(%p, %s, %d, %p): stub\n", This
, debugstr_dmguid(rguidType
), mtTime
, pParam
);
140 static HRESULT WINAPI
IDirectMusicTrack8Impl_IsParamSupported(IDirectMusicTrack8
*iface
,
143 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
145 TRACE("(%p, %s)\n", This
, debugstr_dmguid(rguidType
));
146 /* didn't find any params */
147 TRACE("param unsupported\n");
148 return DMUS_E_TYPE_UNSUPPORTED
;
151 static HRESULT WINAPI
IDirectMusicTrack8Impl_AddNotificationType(IDirectMusicTrack8
*iface
,
154 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
156 TRACE("(%p, %s): method not implemented\n", This
, debugstr_dmguid(notiftype
));
160 static HRESULT WINAPI
IDirectMusicTrack8Impl_RemoveNotificationType(IDirectMusicTrack8
*iface
,
163 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
165 TRACE("(%p, %s): method not implemented\n", This
, debugstr_dmguid(notiftype
));
169 static HRESULT WINAPI
IDirectMusicTrack8Impl_Clone(IDirectMusicTrack8
*iface
, MUSIC_TIME mtStart
,
170 MUSIC_TIME mtEnd
, IDirectMusicTrack
**ppTrack
)
172 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
173 FIXME("(%p, %d, %d, %p): stub\n", This
, mtStart
, mtEnd
, ppTrack
);
177 static HRESULT WINAPI
IDirectMusicTrack8Impl_PlayEx(IDirectMusicTrack8
*iface
, void *pStateData
,
178 REFERENCE_TIME rtStart
, REFERENCE_TIME rtEnd
, REFERENCE_TIME rtOffset
, DWORD dwFlags
,
179 IDirectMusicPerformance
*pPerf
, IDirectMusicSegmentState
*pSegSt
, DWORD dwVirtualID
)
181 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
182 FIXME("(%p, %p, 0x%s, 0x%s, 0x%s, %d, %p, %p, %d): stub\n", This
, pStateData
, wine_dbgstr_longlong(rtStart
),
183 wine_dbgstr_longlong(rtEnd
), wine_dbgstr_longlong(rtOffset
), dwFlags
, pPerf
, pSegSt
, dwVirtualID
);
187 static HRESULT WINAPI
IDirectMusicTrack8Impl_GetParamEx(IDirectMusicTrack8
*iface
,
188 REFGUID rguidType
, REFERENCE_TIME rtTime
, REFERENCE_TIME
*prtNext
, void *pParam
,
189 void *pStateData
, DWORD dwFlags
)
191 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
192 FIXME("(%p, %s, 0x%s, %p, %p, %p, %d): stub\n", This
, debugstr_dmguid(rguidType
),
193 wine_dbgstr_longlong(rtTime
), prtNext
, pParam
, pStateData
, dwFlags
);
197 static HRESULT WINAPI
IDirectMusicTrack8Impl_SetParamEx(IDirectMusicTrack8
*iface
,
198 REFGUID rguidType
, REFERENCE_TIME rtTime
, void *pParam
, void *pStateData
, DWORD dwFlags
)
200 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
201 FIXME("(%p, %s, 0x%s, %p, %p, %d): stub\n", This
, debugstr_dmguid(rguidType
),
202 wine_dbgstr_longlong(rtTime
), pParam
, pStateData
, dwFlags
);
206 static HRESULT WINAPI
IDirectMusicTrack8Impl_Compose(IDirectMusicTrack8
*iface
, IUnknown
*context
,
207 DWORD trackgroup
, IDirectMusicTrack
**track
)
209 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
211 TRACE("(%p, %p, %d, %p): method not implemented\n", This
, context
, trackgroup
, track
);
215 static HRESULT WINAPI
IDirectMusicTrack8Impl_Join(IDirectMusicTrack8
*iface
,
216 IDirectMusicTrack
*newtrack
, MUSIC_TIME join
, IUnknown
*context
, DWORD trackgroup
,
217 IDirectMusicTrack
**resulttrack
)
219 IDirectMusicSegTriggerTrack
*This
= impl_from_IDirectMusicTrack8(iface
);
220 TRACE("(%p, %p, %d, %p, %d, %p): method not implemented\n", This
, newtrack
, join
, context
,
221 trackgroup
, resulttrack
);
225 static const IDirectMusicTrack8Vtbl dmtrack8_vtbl
= {
226 IDirectMusicTrack8Impl_QueryInterface
,
227 IDirectMusicTrack8Impl_AddRef
,
228 IDirectMusicTrack8Impl_Release
,
229 IDirectMusicTrack8Impl_Init
,
230 IDirectMusicTrack8Impl_InitPlay
,
231 IDirectMusicTrack8Impl_EndPlay
,
232 IDirectMusicTrack8Impl_Play
,
233 IDirectMusicTrack8Impl_GetParam
,
234 IDirectMusicTrack8Impl_SetParam
,
235 IDirectMusicTrack8Impl_IsParamSupported
,
236 IDirectMusicTrack8Impl_AddNotificationType
,
237 IDirectMusicTrack8Impl_RemoveNotificationType
,
238 IDirectMusicTrack8Impl_Clone
,
239 IDirectMusicTrack8Impl_PlayEx
,
240 IDirectMusicTrack8Impl_GetParamEx
,
241 IDirectMusicTrack8Impl_SetParamEx
,
242 IDirectMusicTrack8Impl_Compose
,
243 IDirectMusicTrack8Impl_Join
246 static HRESULT
parse_segment(IDirectMusicSegTriggerTrack
*This
, DMUS_PRIVATE_CHUNK
*pChunk
,
249 DMUS_PRIVATE_CHUNK Chunk
;
250 DWORD ListSize
[3], ListCount
[3];
251 LARGE_INTEGER liMove
; /* used when skipping chunks */
254 IDirectMusicObject
* pObject
= NULL
;
255 LPDMUS_PRIVATE_SEGMENT_ITEM pNewItem
= NULL
;
257 if (pChunk
->fccID
!= DMUS_FOURCC_SEGMENT_LIST
) {
258 ERR_(dmfile
)(": %s chunk should be a SEGMENT list\n", debugstr_fourcc (pChunk
->fccID
));
262 ListSize
[0] = pChunk
->dwSize
- sizeof(FOURCC
);
266 IStream_Read (pStm
, &Chunk
, sizeof(FOURCC
)+sizeof(DWORD
), NULL
);
267 ListCount
[0] += sizeof(FOURCC
) + sizeof(DWORD
) + Chunk
.dwSize
;
268 TRACE_(dmfile
)(": %s chunk (size = %d)", debugstr_fourcc (Chunk
.fccID
), Chunk
.dwSize
);
269 switch (Chunk
.fccID
) {
270 case DMUS_FOURCC_SEGMENTITEM_CHUNK
: {
271 TRACE_(dmfile
)(": segment item chunk\n");
272 /** alloc new item entry */
273 pNewItem
= HeapAlloc (GetProcessHeap (), HEAP_ZERO_MEMORY
, sizeof(DMUS_PRIVATE_SEGMENT_ITEM
));
275 return E_OUTOFMEMORY
;
277 IStream_Read (pStm
, &pNewItem
->header
, sizeof(DMUS_IO_SEGMENT_ITEM_HEADER
), NULL
);
278 TRACE_(dmfile
)(" - lTimePhysical: %u\n", pNewItem
->header
.lTimeLogical
);
279 TRACE_(dmfile
)(" - lTimePhysical: %u\n", pNewItem
->header
.lTimePhysical
);
280 TRACE_(dmfile
)(" - dwPlayFlags: 0x%08x\n", pNewItem
->header
.dwPlayFlags
);
281 TRACE_(dmfile
)(" - dwFlags: 0x%08x\n", pNewItem
->header
.dwFlags
);
282 list_add_tail (&This
->Items
, &pNewItem
->entry
);
285 case DMUS_FOURCC_SEGMENTITEMNAME_CHUNK
: {
286 TRACE_(dmfile
)(": segment item name chunk\n");
288 ERR(": pNewItem not allocated, bad chunk order?\n");
291 IStream_Read (pStm
, pNewItem
->wszName
, Chunk
.dwSize
, NULL
);
292 TRACE_(dmfile
)(" - name: %s\n", debugstr_w(pNewItem
->wszName
));
296 IStream_Read (pStm
, &Chunk
.fccID
, sizeof(FOURCC
), NULL
);
297 TRACE_(dmfile
)(": LIST chunk of type %s", debugstr_fourcc(Chunk
.fccID
));
298 ListSize
[1] = Chunk
.dwSize
- sizeof(FOURCC
);
300 switch (Chunk
.fccID
) {
301 case DMUS_FOURCC_REF_LIST
: {
302 FIXME_(dmfile
)(": DMRF (DM References) list\n");
303 hr
= IDirectMusicUtils_IPersistStream_ParseReference(&This
->dmobj
.IPersistStream_iface
,
304 &Chunk
, pStm
, &pObject
);
306 ERR(": could not load Reference\n");
310 ERR(": pNewItem not allocated, bad chunk order?\n");
313 pNewItem
->pObject
= pObject
;
317 TRACE_(dmfile
)(": unknown (skipping)\n");
318 liMove
.QuadPart
= Chunk
.dwSize
- sizeof(FOURCC
);
319 IStream_Seek (pStm
, liMove
, STREAM_SEEK_CUR
, NULL
);
326 TRACE_(dmfile
)(": unknown chunk (irrelevant & skipping)\n");
327 liMove
.QuadPart
= Chunk
.dwSize
;
328 IStream_Seek (pStm
, liMove
, STREAM_SEEK_CUR
, NULL
);
332 TRACE_(dmfile
)(": ListCount[0] = %d < ListSize[0] = %d\n", ListCount
[0], ListSize
[0]);
333 } while (ListCount
[0] < ListSize
[0]);
338 static HRESULT
parse_segments_list(IDirectMusicSegTriggerTrack
*This
, DMUS_PRIVATE_CHUNK
*pChunk
,
342 DMUS_PRIVATE_CHUNK Chunk
;
343 DWORD ListSize
[3], ListCount
[3];
344 LARGE_INTEGER liMove
; /* used when skipping chunks */
346 if (pChunk
->fccID
!= DMUS_FOURCC_SEGMENTS_LIST
) {
347 ERR_(dmfile
)(": %s chunk should be a SEGMENTS list\n", debugstr_fourcc (pChunk
->fccID
));
351 ListSize
[0] = pChunk
->dwSize
- sizeof(FOURCC
);
355 IStream_Read (pStm
, &Chunk
, sizeof(FOURCC
)+sizeof(DWORD
), NULL
);
356 ListCount
[0] += sizeof(FOURCC
) + sizeof(DWORD
) + Chunk
.dwSize
;
357 TRACE_(dmfile
)(": %s chunk (size = %d)", debugstr_fourcc (Chunk
.fccID
), Chunk
.dwSize
);
358 switch (Chunk
.fccID
) {
360 IStream_Read (pStm
, &Chunk
.fccID
, sizeof(FOURCC
), NULL
);
361 TRACE_(dmfile
)(": LIST chunk of type %s", debugstr_fourcc(Chunk
.fccID
));
362 ListSize
[1] = Chunk
.dwSize
- sizeof(FOURCC
);
364 switch (Chunk
.fccID
) {
365 case DMUS_FOURCC_SEGMENT_LIST
: {
366 TRACE_(dmfile
)(": SEGMENT list\n");
367 hr
= parse_segment(This
, &Chunk
, pStm
);
368 if (FAILED(hr
)) return hr
;
372 TRACE_(dmfile
)(": unknown (skipping)\n");
373 liMove
.QuadPart
= Chunk
.dwSize
- sizeof(FOURCC
);
374 IStream_Seek (pStm
, liMove
, STREAM_SEEK_CUR
, NULL
);
381 TRACE_(dmfile
)(": unknown chunk (irrelevant & skipping)\n");
382 liMove
.QuadPart
= Chunk
.dwSize
;
383 IStream_Seek (pStm
, liMove
, STREAM_SEEK_CUR
, NULL
);
387 TRACE_(dmfile
)(": ListCount[0] = %d < ListSize[0] = %d\n", ListCount
[0], ListSize
[0]);
388 } while (ListCount
[0] < ListSize
[0]);
393 static HRESULT
parse_seqtrack_list(IDirectMusicSegTriggerTrack
*This
, DMUS_PRIVATE_CHUNK
*pChunk
,
397 DMUS_PRIVATE_CHUNK Chunk
;
398 DWORD ListSize
[3], ListCount
[3];
399 LARGE_INTEGER liMove
; /* used when skipping chunks */
401 if (pChunk
->fccID
!= DMUS_FOURCC_SEGTRACK_LIST
) {
402 ERR_(dmfile
)(": %s chunk should be a SEGTRACK list\n", debugstr_fourcc (pChunk
->fccID
));
406 ListSize
[0] = pChunk
->dwSize
- sizeof(FOURCC
);
410 IStream_Read (pStm
, &Chunk
, sizeof(FOURCC
)+sizeof(DWORD
), NULL
);
411 ListCount
[0] += sizeof(FOURCC
) + sizeof(DWORD
) + Chunk
.dwSize
;
412 TRACE_(dmfile
)(": %s chunk (size = %d)", debugstr_fourcc (Chunk
.fccID
), Chunk
.dwSize
);
413 switch (Chunk
.fccID
) {
414 case DMUS_FOURCC_SEGTRACK_CHUNK
: {
415 TRACE_(dmfile
)(": segment trigger track chunk\n");
416 liMove
.QuadPart
= Chunk
.dwSize
;
417 IStream_Seek (pStm
, liMove
, STREAM_SEEK_CUR
, NULL
);
421 IStream_Read (pStm
, &Chunk
.fccID
, sizeof(FOURCC
), NULL
);
422 TRACE_(dmfile
)(": LIST chunk of type %s", debugstr_fourcc(Chunk
.fccID
));
423 ListSize
[1] = Chunk
.dwSize
- sizeof(FOURCC
);
425 switch (Chunk
.fccID
) {
426 case DMUS_FOURCC_SEGMENTS_LIST
: {
427 TRACE_(dmfile
)(": SEGMENTS list\n");
428 hr
= parse_segments_list(This
, &Chunk
, pStm
);
429 if (FAILED(hr
)) return hr
;
433 TRACE_(dmfile
)(": unknown (skipping)\n");
434 liMove
.QuadPart
= Chunk
.dwSize
- sizeof(FOURCC
);
435 IStream_Seek (pStm
, liMove
, STREAM_SEEK_CUR
, NULL
);
442 TRACE_(dmfile
)(": unknown chunk (irrelevant & skipping)\n");
443 liMove
.QuadPart
= Chunk
.dwSize
;
444 IStream_Seek (pStm
, liMove
, STREAM_SEEK_CUR
, NULL
);
448 TRACE_(dmfile
)(": ListCount[0] = %d < ListSize[0] = %d\n", ListCount
[0], ListSize
[0]);
449 } while (ListCount
[0] < ListSize
[0]);
454 static inline IDirectMusicSegTriggerTrack
*impl_from_IPersistStream(IPersistStream
*iface
)
456 return CONTAINING_RECORD(iface
, IDirectMusicSegTriggerTrack
, dmobj
.IPersistStream_iface
);
459 static HRESULT WINAPI
IPersistStreamImpl_Load(IPersistStream
*iface
, IStream
*pStm
)
461 IDirectMusicSegTriggerTrack
*This
= impl_from_IPersistStream(iface
);
462 DMUS_PRIVATE_CHUNK Chunk
;
463 LARGE_INTEGER liMove
;
466 TRACE("(%p, %p): Loading\n", This
, pStm
);
468 IStream_Read (pStm
, &Chunk
, sizeof(FOURCC
)+sizeof(DWORD
), NULL
);
469 TRACE_(dmfile
)(": %s chunk (size = %d)", debugstr_fourcc (Chunk
.fccID
), Chunk
.dwSize
);
470 switch (Chunk
.fccID
) {
472 IStream_Read (pStm
, &Chunk
.fccID
, sizeof(FOURCC
), NULL
);
473 TRACE_(dmfile
)(": %s chunk (size = %d)", debugstr_fourcc (Chunk
.fccID
), Chunk
.dwSize
);
474 switch (Chunk
.fccID
) {
475 case DMUS_FOURCC_SEGTRACK_LIST
: {
476 TRACE_(dmfile
)(": segment trigger track list\n");
477 hr
= parse_seqtrack_list(This
, &Chunk
, pStm
);
478 if (FAILED(hr
)) return hr
;
482 TRACE_(dmfile
)(": unexpected chunk; loading failed)\n");
483 liMove
.QuadPart
= Chunk
.dwSize
;
484 IStream_Seek (pStm
, liMove
, STREAM_SEEK_CUR
, NULL
);
488 TRACE_(dmfile
)(": reading finished\n");
492 TRACE_(dmfile
)(": unexpected chunk; loading failed)\n");
493 liMove
.QuadPart
= Chunk
.dwSize
;
494 IStream_Seek (pStm
, liMove
, STREAM_SEEK_CUR
, NULL
); /* skip the rest of the chunk */
502 static const IPersistStreamVtbl persiststream_vtbl
= {
503 dmobj_IPersistStream_QueryInterface
,
504 dmobj_IPersistStream_AddRef
,
505 dmobj_IPersistStream_Release
,
506 dmobj_IPersistStream_GetClassID
,
507 unimpl_IPersistStream_IsDirty
,
508 IPersistStreamImpl_Load
,
509 unimpl_IPersistStream_Save
,
510 unimpl_IPersistStream_GetSizeMax
513 /* for ClassFactory */
514 HRESULT WINAPI
create_dmsegtriggertrack(REFIID lpcGUID
, void **ppobj
)
516 IDirectMusicSegTriggerTrack
*track
;
519 track
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*track
));
522 return E_OUTOFMEMORY
;
524 track
->IDirectMusicTrack8_iface
.lpVtbl
= &dmtrack8_vtbl
;
526 dmobject_init(&track
->dmobj
, &CLSID_DirectMusicSegTriggerTrack
,
527 (IUnknown
*)&track
->IDirectMusicTrack8_iface
);
528 track
->dmobj
.IPersistStream_iface
.lpVtbl
= &persiststream_vtbl
;
529 list_init(&track
->Items
);
532 hr
= IDirectMusicTrack8_QueryInterface(&track
->IDirectMusicTrack8_iface
, lpcGUID
, ppobj
);
533 IDirectMusicTrack8_Release(&track
->IDirectMusicTrack8_iface
);