1 /* IDirectMusicChordTrack 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 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 "dmstyle_private.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
24 WINE_DECLARE_DEBUG_CHANNEL(dmfile);
26 /*****************************************************************************
27 * IDirectMusicChordTrack implementation
29 /* IDirectMusicChordTrack IUnknown part: */
30 HRESULT WINAPI IDirectMusicChordTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
31 ICOM_THIS_MULTI(IDirectMusicChordTrack, 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 IDirectMusicChordTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
38 } else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
39 || IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
40 *ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
41 IDirectMusicChordTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
43 } else if (IsEqualIID (riid, &IID_IPersistStream)) {
44 *ppobj = (LPPERSISTSTREAM)&This->PersistStreamVtbl;
45 IDirectMusicChordTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
49 WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
53 ULONG WINAPI IDirectMusicChordTrack_IUnknown_AddRef (LPUNKNOWN iface) {
54 ICOM_THIS_MULTI(IDirectMusicChordTrack, UnknownVtbl, iface);
55 TRACE("(%p): AddRef from %ld\n", This, This->ref);
59 ULONG WINAPI IDirectMusicChordTrack_IUnknown_Release (LPUNKNOWN iface) {
60 ICOM_THIS_MULTI(IDirectMusicChordTrack, UnknownVtbl, iface);
61 ULONG ref = --This->ref;
62 TRACE("(%p): ReleaseRef to %ld\n", This, This->ref);
64 HeapFree(GetProcessHeap(), 0, This);
69 ICOM_VTABLE(IUnknown) DirectMusicChordTrack_Unknown_Vtbl = {
70 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
71 IDirectMusicChordTrack_IUnknown_QueryInterface,
72 IDirectMusicChordTrack_IUnknown_AddRef,
73 IDirectMusicChordTrack_IUnknown_Release
76 /* IDirectMusicChordTrack IDirectMusicTrack8 part: */
77 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
78 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
79 return IDirectMusicChordTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
82 ULONG WINAPI IDirectMusicChordTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
83 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
84 return IDirectMusicChordTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
87 ULONG WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
88 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
89 return IDirectMusicChordTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
92 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment) {
93 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
94 FIXME("(%p, %p): stub\n", This, pSegment);
98 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
100 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
101 FIXME("(%p, %p, %p, %p, %ld, %ld): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
105 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
107 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
108 FIXME("(%p, %p): stub\n", This, pStateData);
112 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Play (LPDIRECTMUSICTRACK8 iface, void* pStateData, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, MUSIC_TIME mtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID)
114 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
115 FIXME("(%p, %p, %ld, %ld, %ld, %ld, %p, %p, %ld): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
119 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
120 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
121 FIXME("(%p, %s, %ld, %p, %p): stub\n", This, debugstr_dmguid(rguidType), mtTime, pmtNext, pParam);
125 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
126 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
127 FIXME("(%p, %s, %ld, %p): stub\n", This, debugstr_dmguid(rguidType), mtTime, pParam);
131 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
132 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
134 TRACE("(%p, %s): ", This, debugstr_dmguid(rguidType));
135 if (IsEqualGUID (rguidType, &GUID_BandParam)
136 || IsEqualGUID (rguidType, &GUID_ChordParam)
137 || IsEqualGUID (rguidType, &GUID_RhythmParam)) {
138 TRACE("param supported\n");
141 TRACE("param unsupported\n");
142 return DMUS_E_TYPE_UNSUPPORTED;
145 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
146 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
147 FIXME("(%p, %s): stub\n", This, debugstr_dmguid(rguidNotificationType));
151 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
152 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
153 FIXME("(%p, %s): stub\n", This, debugstr_dmguid(rguidNotificationType));
157 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
158 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
159 FIXME("(%p, %ld, %ld, %p): stub\n", This, mtStart, mtEnd, ppTrack);
163 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_PlayEx (LPDIRECTMUSICTRACK8 iface, void* pStateData, REFERENCE_TIME rtStart, REFERENCE_TIME rtEnd, REFERENCE_TIME rtOffset, DWORD dwFlags, IDirectMusicPerformance* pPerf, IDirectMusicSegmentState* pSegSt, DWORD dwVirtualID) {
164 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
165 FIXME("(%p, %p, %lli, %lli, %lli, %ld, %p, %p, %ld): stub\n", This, pStateData, rtStart, rtEnd, rtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
169 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
170 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
171 FIXME("(%p, %s, %lli, %p, %p, %p, %ld): stub\n", This, debugstr_dmguid(rguidType), rtTime, prtNext, pParam, pStateData, dwFlags);
175 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
176 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
177 FIXME("(%p, %s, %lli, %p, %p, %ld): stub\n", This, debugstr_dmguid(rguidType), rtTime, pParam, pStateData, dwFlags);
181 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Compose (LPDIRECTMUSICTRACK8 iface, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
182 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
183 FIXME("(%p, %p, %ld, %p): stub\n", This, pContext, dwTrackGroup, ppResultTrack);
187 HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
188 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
189 FIXME("(%p, %p, %ld, %p, %ld, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
193 ICOM_VTABLE(IDirectMusicTrack8) DirectMusicChordTrack_Track_Vtbl = {
194 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
195 IDirectMusicChordTrack_IDirectMusicTrack_QueryInterface,
196 IDirectMusicChordTrack_IDirectMusicTrack_AddRef,
197 IDirectMusicChordTrack_IDirectMusicTrack_Release,
198 IDirectMusicChordTrack_IDirectMusicTrack_Init,
199 IDirectMusicChordTrack_IDirectMusicTrack_InitPlay,
200 IDirectMusicChordTrack_IDirectMusicTrack_EndPlay,
201 IDirectMusicChordTrack_IDirectMusicTrack_Play,
202 IDirectMusicChordTrack_IDirectMusicTrack_GetParam,
203 IDirectMusicChordTrack_IDirectMusicTrack_SetParam,
204 IDirectMusicChordTrack_IDirectMusicTrack_IsParamSupported,
205 IDirectMusicChordTrack_IDirectMusicTrack_AddNotificationType,
206 IDirectMusicChordTrack_IDirectMusicTrack_RemoveNotificationType,
207 IDirectMusicChordTrack_IDirectMusicTrack_Clone,
208 IDirectMusicChordTrack_IDirectMusicTrack_PlayEx,
209 IDirectMusicChordTrack_IDirectMusicTrack_GetParamEx,
210 IDirectMusicChordTrack_IDirectMusicTrack_SetParamEx,
211 IDirectMusicChordTrack_IDirectMusicTrack_Compose,
212 IDirectMusicChordTrack_IDirectMusicTrack_Join
215 /* IDirectMusicChordTrack IPersistStream part: */
216 HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
217 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
218 return IDirectMusicChordTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
221 ULONG WINAPI IDirectMusicChordTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
222 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
223 return IDirectMusicChordTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
226 ULONG WINAPI IDirectMusicChordTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
227 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
228 return IDirectMusicChordTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
231 HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
232 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
233 TRACE("(%p, %p)\n", This, pClassID);
234 memcpy(pClassID, &CLSID_DirectMusicChordTrack, sizeof(CLSID));
238 HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
239 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
240 FIXME("(%p): stub, always S_FALSE\n", This);
244 static HRESULT IDirectMusicChordTrack_IPersistStream_ParseChordTrackList (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm) {
246 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
247 DMUS_PRIVATE_CHUNK Chunk;
248 DWORD ListSize[3], ListCount[3];
249 LARGE_INTEGER liMove; /* used when skipping chunks */
251 if (pChunk->fccID != DMUS_FOURCC_CHORDTRACK_LIST) {
252 ERR_(dmfile)(": %s chunk should be a CHORDTRACK list\n", debugstr_fourcc (pChunk->fccID));
256 ListSize[0] = pChunk->dwSize - sizeof(FOURCC);
260 IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
261 ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
262 TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
263 switch (Chunk.fccID) {
264 case DMUS_FOURCC_CHORDTRACKHEADER_CHUNK: {
265 TRACE_(dmfile)(": Chord track header chunk\n");
266 IStream_Read (pStm, &This->dwScale, sizeof(DWORD), NULL);
267 TRACE_(dmfile)(" - dwScale: %ld\n", This->dwScale);
270 case DMUS_FOURCC_CHORDTRACKBODY_CHUNK: {
275 DMUS_IO_SUBCHORD subchords;
277 TRACE_(dmfile)(": Chord track body chunk\n");
279 IStream_Read (pStm, &sz, sizeof(DWORD), NULL);
280 TRACE_(dmfile)(" - sizeof(DMUS_IO_CHORD): %ld\n", sz);
281 if (sz != sizeof(DMUS_IO_CHORD)) return E_FAIL;
282 IStream_Read (pStm, &body, sizeof(DMUS_IO_CHORD), NULL);
283 TRACE_(dmfile)(" - wszName: %s\n", debugstr_w(body.wszName));
284 TRACE_(dmfile)(" - mtTime: %lu\n", body.mtTime);
285 TRACE_(dmfile)(" - wMeasure: %u\n", body.wMeasure);
286 TRACE_(dmfile)(" - bBeat: %u\n", body.bBeat);
287 TRACE_(dmfile)(" - bFlags: 0x%02x\n", body.bFlags);
289 IStream_Read (pStm, &num, sizeof(DWORD), NULL);
290 TRACE_(dmfile)(" - # DMUS_IO_SUBCHORDS: %ld\n", num);
291 IStream_Read (pStm, &sz, sizeof(DWORD), NULL);
292 TRACE_(dmfile)(" - sizeof(DMUS_IO_SUBCHORDS): %ld\n", sz);
293 if (sz != sizeof(DMUS_IO_SUBCHORD)) return E_FAIL;
295 for (it = 0; it < num; ++it) {
296 IStream_Read (pStm, &subchords, sizeof(DMUS_IO_SUBCHORD), NULL);
297 TRACE_(dmfile)("DMUS_IO_SUBCHORD #%ld\n", it+1);
298 TRACE_(dmfile)(" - dwChordPattern: %lu\n", subchords.dwChordPattern);
299 TRACE_(dmfile)(" - dwScalePattern: %lu\n", subchords.dwScalePattern);
300 TRACE_(dmfile)(" - dwInversionPoints: %lu\n", subchords.dwInversionPoints);
301 TRACE_(dmfile)(" - dwLevels: %lu\n", subchords.dwLevels);
302 TRACE_(dmfile)(" - bChordRoot: %u\n", subchords.bChordRoot);
303 TRACE_(dmfile)(" - bScaleRoot: %u\n", subchords.bScaleRoot);
308 TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
309 liMove.QuadPart = Chunk.dwSize;
310 IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
314 TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
315 } while (ListCount[0] < ListSize[0]);
320 HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
321 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
323 DMUS_PRIVATE_CHUNK Chunk;
324 LARGE_INTEGER liMove;
327 TRACE("(%p, %p): Loading\n", This, pStm);
329 IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
330 TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
331 switch (Chunk.fccID) {
333 IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL);
334 TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
335 switch (Chunk.fccID) {
336 case DMUS_FOURCC_CHORDTRACK_LIST: {
337 TRACE_(dmfile)(": Chord track list\n");
338 hr = IDirectMusicChordTrack_IPersistStream_ParseChordTrackList (iface, &Chunk, pStm);
339 if (FAILED(hr)) return hr;
343 TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
344 liMove.QuadPart = Chunk.dwSize;
345 IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
349 TRACE_(dmfile)(": reading finished\n");
353 TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
354 liMove.QuadPart = Chunk.dwSize;
355 IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
363 HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
364 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
365 FIXME("(%p): Saving not implemented yet\n", This);
369 HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
370 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
371 FIXME("(%p, %p): stub\n", This, pcbSize);
375 ICOM_VTABLE(IPersistStream) DirectMusicChordTrack_PersistStream_Vtbl = {
376 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
377 IDirectMusicChordTrack_IPersistStream_QueryInterface,
378 IDirectMusicChordTrack_IPersistStream_AddRef,
379 IDirectMusicChordTrack_IPersistStream_Release,
380 IDirectMusicChordTrack_IPersistStream_GetClassID,
381 IDirectMusicChordTrack_IPersistStream_IsDirty,
382 IDirectMusicChordTrack_IPersistStream_Load,
383 IDirectMusicChordTrack_IPersistStream_Save,
384 IDirectMusicChordTrack_IPersistStream_GetSizeMax
387 /* for ClassFactory */
388 HRESULT WINAPI DMUSIC_CreateDirectMusicChordTrack (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) {
389 IDirectMusicChordTrack* track;
391 track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordTrack));
393 *ppobj = (LPVOID) NULL;
394 return E_OUTOFMEMORY;
396 track->UnknownVtbl = &DirectMusicChordTrack_Unknown_Vtbl;
397 track->TrackVtbl = &DirectMusicChordTrack_Track_Vtbl;
398 track->PersistStreamVtbl = &DirectMusicChordTrack_PersistStream_Vtbl;
399 track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
400 DM_STRUCT_INIT(track->pDesc);
401 track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
402 memcpy (&track->pDesc->guidClass, &CLSID_DirectMusicChordTrack, sizeof (CLSID));
403 track->ref = 0; /* will be inited by QueryInterface */
405 return IDirectMusicChordTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);