dmstyle: Implement the E_NOTIMPL methods of IDirectMusicTrack8.
[wine.git] / dlls / dmstyle / chordtrack.c
blob40f90180b67ca6e6acca8c19941d7525a3a9ba92
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
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 "dmstyle_private.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(dmstyle);
24 WINE_DECLARE_DEBUG_CHANNEL(dmfile);
26 static ULONG WINAPI IDirectMusicChordTrack_IUnknown_AddRef (LPUNKNOWN iface);
27 static ULONG WINAPI IDirectMusicChordTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface);
28 static ULONG WINAPI IDirectMusicChordTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface);
30 /*****************************************************************************
31 * IDirectMusicChordTrack implementation
33 typedef struct IDirectMusicChordTrack {
34 const IUnknownVtbl *UnknownVtbl;
35 const IDirectMusicTrack8Vtbl *TrackVtbl;
36 const IPersistStreamVtbl *PersistStreamVtbl;
37 LONG ref;
38 DMUS_OBJECTDESC *pDesc;
39 DWORD dwScale;
40 } IDirectMusicChordTrack;
42 /* IDirectMusicChordTrack IUnknown part: */
43 static HRESULT WINAPI IDirectMusicChordTrack_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) {
44 ICOM_THIS_MULTI(IDirectMusicChordTrack, UnknownVtbl, iface);
45 TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj);
47 if (IsEqualIID (riid, &IID_IUnknown)) {
48 *ppobj = &This->UnknownVtbl;
49 IDirectMusicChordTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
50 return S_OK;
51 } else if (IsEqualIID (riid, &IID_IDirectMusicTrack)
52 || IsEqualIID (riid, &IID_IDirectMusicTrack8)) {
53 *ppobj = (LPDIRECTMUSICTRACK8)&This->TrackVtbl;
54 IDirectMusicChordTrack_IDirectMusicTrack_AddRef ((LPDIRECTMUSICTRACK8)&This->TrackVtbl);
55 return S_OK;
56 } else if (IsEqualIID (riid, &IID_IPersistStream)) {
57 *ppobj = &This->PersistStreamVtbl;
58 IDirectMusicChordTrack_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl);
59 return S_OK;
62 WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj);
63 return E_NOINTERFACE;
66 static ULONG WINAPI IDirectMusicChordTrack_IUnknown_AddRef (LPUNKNOWN iface) {
67 ICOM_THIS_MULTI(IDirectMusicChordTrack, UnknownVtbl, iface);
68 ULONG ref = InterlockedIncrement(&This->ref);
70 TRACE("(%p): AddRef from %d\n", This, ref - 1);
72 DMSTYLE_LockModule();
74 return ref;
77 static ULONG WINAPI IDirectMusicChordTrack_IUnknown_Release (LPUNKNOWN iface) {
78 ICOM_THIS_MULTI(IDirectMusicChordTrack, UnknownVtbl, iface);
79 ULONG ref = InterlockedDecrement(&This->ref);
81 TRACE("(%p): ReleaseRef to %d\n", This, ref);
83 if (ref == 0) {
84 HeapFree(GetProcessHeap(), 0, This);
87 DMSTYLE_UnlockModule();
89 return ref;
92 static const IUnknownVtbl DirectMusicChordTrack_Unknown_Vtbl = {
93 IDirectMusicChordTrack_IUnknown_QueryInterface,
94 IDirectMusicChordTrack_IUnknown_AddRef,
95 IDirectMusicChordTrack_IUnknown_Release
98 /* IDirectMusicChordTrack IDirectMusicTrack8 part: */
99 static inline IDirectMusicChordTrack *impl_from_IDirectMusicTrack8(IDirectMusicTrack8 *iface)
101 return CONTAINING_RECORD(iface, IDirectMusicChordTrack, TrackVtbl);
104 static HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_QueryInterface (LPDIRECTMUSICTRACK8 iface, REFIID riid, LPVOID *ppobj) {
105 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
106 return IDirectMusicChordTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
109 static ULONG WINAPI IDirectMusicChordTrack_IDirectMusicTrack_AddRef (LPDIRECTMUSICTRACK8 iface) {
110 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
111 return IDirectMusicChordTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
114 static ULONG WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRACK8 iface) {
115 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
116 return IDirectMusicChordTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
119 static HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment) {
120 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
121 FIXME("(%p, %p): stub\n", This, pSegment);
122 return S_OK;
125 static HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_InitPlay (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegmentState* pSegmentState, IDirectMusicPerformance* pPerformance, void** ppStateData, DWORD dwVirtualTrack8ID, DWORD dwFlags)
127 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
128 FIXME("(%p, %p, %p, %p, %d, %d): stub\n", This, pSegmentState, pPerformance, ppStateData, dwVirtualTrack8ID, dwFlags);
129 return S_OK;
132 static HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_EndPlay (LPDIRECTMUSICTRACK8 iface, void* pStateData)
134 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
135 FIXME("(%p, %p): stub\n", This, pStateData);
136 return S_OK;
139 static 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)
141 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
142 FIXME("(%p, %p, %d, %d, %d, %d, %p, %p, %d): stub\n", This, pStateData, mtStart, mtEnd, mtOffset, dwFlags, pPerf, pSegSt, dwVirtualID);
143 return S_OK;
146 static HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_GetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, MUSIC_TIME* pmtNext, void* pParam) {
147 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
148 FIXME("(%p, %s, %d, %p, %p): stub\n", This, debugstr_dmguid(rguidType), mtTime, pmtNext, pParam);
149 return S_OK;
152 static HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_SetParam (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, MUSIC_TIME mtTime, void* pParam) {
153 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
154 FIXME("(%p, %s, %d, %p): stub\n", This, debugstr_dmguid(rguidType), mtTime, pParam);
155 return S_OK;
158 static HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_IsParamSupported (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType) {
159 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
161 TRACE("(%p, %s)\n", This, debugstr_dmguid(rguidType));
163 if (!rguidType)
164 return E_POINTER;
166 if (IsEqualGUID (rguidType, &GUID_BandParam)
167 || IsEqualGUID (rguidType, &GUID_ChordParam)
168 || IsEqualGUID (rguidType, &GUID_RhythmParam)) {
169 TRACE("param supported\n");
170 return S_OK;
172 TRACE("param unsupported\n");
173 return DMUS_E_TYPE_UNSUPPORTED;
176 static HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_AddNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
177 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
178 FIXME("(%p, %s): stub\n", This, debugstr_dmguid(rguidNotificationType));
179 return S_OK;
182 static HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_RemoveNotificationType (LPDIRECTMUSICTRACK8 iface, REFGUID rguidNotificationType) {
183 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
184 FIXME("(%p, %s): stub\n", This, debugstr_dmguid(rguidNotificationType));
185 return S_OK;
188 static HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Clone (LPDIRECTMUSICTRACK8 iface, MUSIC_TIME mtStart, MUSIC_TIME mtEnd, IDirectMusicTrack** ppTrack) {
189 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
190 FIXME("(%p, %d, %d, %p): stub\n", This, mtStart, mtEnd, ppTrack);
191 return S_OK;
194 static 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) {
195 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
196 FIXME("(%p, %p, 0x%s, 0x%s, 0x%s, %d, %p, %p, %d): stub\n", This, pStateData, wine_dbgstr_longlong(rtStart),
197 wine_dbgstr_longlong(rtEnd), wine_dbgstr_longlong(rtOffset), dwFlags, pPerf, pSegSt, dwVirtualID);
198 return S_OK;
201 static HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_GetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, REFERENCE_TIME* prtNext, void* pParam, void* pStateData, DWORD dwFlags) {
202 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
203 FIXME("(%p, %s, 0x%s, %p, %p, %p, %d): stub\n", This, debugstr_dmguid(rguidType),
204 wine_dbgstr_longlong(rtTime), prtNext, pParam, pStateData, dwFlags);
205 return S_OK;
208 static HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_SetParamEx (LPDIRECTMUSICTRACK8 iface, REFGUID rguidType, REFERENCE_TIME rtTime, void* pParam, void* pStateData, DWORD dwFlags) {
209 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
210 FIXME("(%p, %s, 0x%s, %p, %p, %d): stub\n", This, debugstr_dmguid(rguidType),
211 wine_dbgstr_longlong(rtTime), pParam, pStateData, dwFlags);
212 return S_OK;
215 static HRESULT WINAPI IDirectMusicTrack8Impl_Compose(IDirectMusicTrack8 *iface, IUnknown *context,
216 DWORD trackgroup, IDirectMusicTrack **track)
218 IDirectMusicChordTrack *This = impl_from_IDirectMusicTrack8(iface);
220 TRACE("(%p, %p, %d, %p): method not implemented\n", This, context, trackgroup, track);
221 return E_NOTIMPL;
224 static HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Join (LPDIRECTMUSICTRACK8 iface, IDirectMusicTrack* pNewTrack, MUSIC_TIME mtJoin, IUnknown* pContext, DWORD dwTrackGroup, IDirectMusicTrack** ppResultTrack) {
225 ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
226 FIXME("(%p, %p, %d, %p, %d, %p): stub\n", This, pNewTrack, mtJoin, pContext, dwTrackGroup, ppResultTrack);
227 return S_OK;
230 static const IDirectMusicTrack8Vtbl DirectMusicChordTrack_Track_Vtbl = {
231 IDirectMusicChordTrack_IDirectMusicTrack_QueryInterface,
232 IDirectMusicChordTrack_IDirectMusicTrack_AddRef,
233 IDirectMusicChordTrack_IDirectMusicTrack_Release,
234 IDirectMusicChordTrack_IDirectMusicTrack_Init,
235 IDirectMusicChordTrack_IDirectMusicTrack_InitPlay,
236 IDirectMusicChordTrack_IDirectMusicTrack_EndPlay,
237 IDirectMusicChordTrack_IDirectMusicTrack_Play,
238 IDirectMusicChordTrack_IDirectMusicTrack_GetParam,
239 IDirectMusicChordTrack_IDirectMusicTrack_SetParam,
240 IDirectMusicChordTrack_IDirectMusicTrack_IsParamSupported,
241 IDirectMusicChordTrack_IDirectMusicTrack_AddNotificationType,
242 IDirectMusicChordTrack_IDirectMusicTrack_RemoveNotificationType,
243 IDirectMusicChordTrack_IDirectMusicTrack_Clone,
244 IDirectMusicChordTrack_IDirectMusicTrack_PlayEx,
245 IDirectMusicChordTrack_IDirectMusicTrack_GetParamEx,
246 IDirectMusicChordTrack_IDirectMusicTrack_SetParamEx,
247 IDirectMusicTrack8Impl_Compose,
248 IDirectMusicChordTrack_IDirectMusicTrack_Join
251 /* IDirectMusicChordTrack IPersistStream part: */
252 static HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) {
253 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
254 return IDirectMusicChordTrack_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj);
257 static ULONG WINAPI IDirectMusicChordTrack_IPersistStream_AddRef (LPPERSISTSTREAM iface) {
258 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
259 return IDirectMusicChordTrack_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl);
262 static ULONG WINAPI IDirectMusicChordTrack_IPersistStream_Release (LPPERSISTSTREAM iface) {
263 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
264 return IDirectMusicChordTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
267 static HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
268 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
269 TRACE("(%p, %p)\n", This, pClassID);
270 *pClassID = CLSID_DirectMusicChordTrack;
271 return S_OK;
274 static HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
275 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
276 FIXME("(%p): stub, always S_FALSE\n", This);
277 return S_FALSE;
280 static HRESULT IDirectMusicChordTrack_IPersistStream_ParseChordTrackList (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm) {
282 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
283 DMUS_PRIVATE_CHUNK Chunk;
284 DWORD ListSize[3], ListCount[3];
285 LARGE_INTEGER liMove; /* used when skipping chunks */
287 if (pChunk->fccID != DMUS_FOURCC_CHORDTRACK_LIST) {
288 ERR_(dmfile)(": %s chunk should be a CHORDTRACK list\n", debugstr_fourcc (pChunk->fccID));
289 return E_FAIL;
292 ListSize[0] = pChunk->dwSize - sizeof(FOURCC);
293 ListCount[0] = 0;
295 do {
296 IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
297 ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
298 TRACE_(dmfile)(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
299 switch (Chunk.fccID) {
300 case DMUS_FOURCC_CHORDTRACKHEADER_CHUNK: {
301 TRACE_(dmfile)(": Chord track header chunk\n");
302 IStream_Read (pStm, &This->dwScale, sizeof(DWORD), NULL);
303 TRACE_(dmfile)(" - dwScale: %d\n", This->dwScale);
304 break;
306 case DMUS_FOURCC_CHORDTRACKBODY_CHUNK: {
307 DWORD sz;
308 DWORD it;
309 DWORD num;
310 DMUS_IO_CHORD body;
311 DMUS_IO_SUBCHORD subchords;
313 TRACE_(dmfile)(": Chord track body chunk\n");
315 IStream_Read (pStm, &sz, sizeof(DWORD), NULL);
316 TRACE_(dmfile)(" - sizeof(DMUS_IO_CHORD): %d\n", sz);
317 if (sz != sizeof(DMUS_IO_CHORD)) return E_FAIL;
318 IStream_Read (pStm, &body, sizeof(DMUS_IO_CHORD), NULL);
319 TRACE_(dmfile)(" - wszName: %s\n", debugstr_w(body.wszName));
320 TRACE_(dmfile)(" - mtTime: %u\n", body.mtTime);
321 TRACE_(dmfile)(" - wMeasure: %u\n", body.wMeasure);
322 TRACE_(dmfile)(" - bBeat: %u\n", body.bBeat);
323 TRACE_(dmfile)(" - bFlags: 0x%02x\n", body.bFlags);
325 IStream_Read (pStm, &num, sizeof(DWORD), NULL);
326 TRACE_(dmfile)(" - # DMUS_IO_SUBCHORDS: %d\n", num);
327 IStream_Read (pStm, &sz, sizeof(DWORD), NULL);
328 TRACE_(dmfile)(" - sizeof(DMUS_IO_SUBCHORDS): %d\n", sz);
329 if (sz != sizeof(DMUS_IO_SUBCHORD)) return E_FAIL;
331 for (it = 0; it < num; ++it) {
332 IStream_Read (pStm, &subchords, sizeof(DMUS_IO_SUBCHORD), NULL);
333 TRACE_(dmfile)("DMUS_IO_SUBCHORD #%d\n", it+1);
334 TRACE_(dmfile)(" - dwChordPattern: %u\n", subchords.dwChordPattern);
335 TRACE_(dmfile)(" - dwScalePattern: %u\n", subchords.dwScalePattern);
336 TRACE_(dmfile)(" - dwInversionPoints: %u\n", subchords.dwInversionPoints);
337 TRACE_(dmfile)(" - dwLevels: %u\n", subchords.dwLevels);
338 TRACE_(dmfile)(" - bChordRoot: %u\n", subchords.bChordRoot);
339 TRACE_(dmfile)(" - bScaleRoot: %u\n", subchords.bScaleRoot);
341 break;
343 default: {
344 TRACE_(dmfile)(": unknown chunk (irrelevant & skipping)\n");
345 liMove.QuadPart = Chunk.dwSize;
346 IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
347 break;
350 TRACE_(dmfile)(": ListCount[0] = %d < ListSize[0] = %d\n", ListCount[0], ListSize[0]);
351 } while (ListCount[0] < ListSize[0]);
353 return S_OK;
356 static HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
357 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
359 DMUS_PRIVATE_CHUNK Chunk;
360 LARGE_INTEGER liMove;
361 HRESULT hr;
363 TRACE("(%p, %p): Loading\n", This, pStm);
365 IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
366 TRACE_(dmfile)(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
367 switch (Chunk.fccID) {
368 case FOURCC_LIST: {
369 IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL);
370 TRACE_(dmfile)(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
371 switch (Chunk.fccID) {
372 case DMUS_FOURCC_CHORDTRACK_LIST: {
373 TRACE_(dmfile)(": Chord track list\n");
374 hr = IDirectMusicChordTrack_IPersistStream_ParseChordTrackList (iface, &Chunk, pStm);
375 if (FAILED(hr)) return hr;
376 break;
378 default: {
379 TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
380 liMove.QuadPart = Chunk.dwSize;
381 IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
382 return E_FAIL;
385 TRACE_(dmfile)(": reading finished\n");
386 break;
388 default: {
389 TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
390 liMove.QuadPart = Chunk.dwSize;
391 IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
392 return E_FAIL;
396 return S_OK;
399 static HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
400 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
401 FIXME("(%p): Saving not implemented yet\n", This);
402 return E_NOTIMPL;
405 static HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
406 ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
407 FIXME("(%p, %p): stub\n", This, pcbSize);
408 return E_NOTIMPL;
411 static const IPersistStreamVtbl DirectMusicChordTrack_PersistStream_Vtbl = {
412 IDirectMusicChordTrack_IPersistStream_QueryInterface,
413 IDirectMusicChordTrack_IPersistStream_AddRef,
414 IDirectMusicChordTrack_IPersistStream_Release,
415 IDirectMusicChordTrack_IPersistStream_GetClassID,
416 IDirectMusicChordTrack_IPersistStream_IsDirty,
417 IDirectMusicChordTrack_IPersistStream_Load,
418 IDirectMusicChordTrack_IPersistStream_Save,
419 IDirectMusicChordTrack_IPersistStream_GetSizeMax
422 /* for ClassFactory */
423 HRESULT WINAPI create_dmchordtrack(REFIID lpcGUID, void **ppobj)
425 IDirectMusicChordTrack* track;
427 track = HeapAlloc (GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordTrack));
428 if (NULL == track) {
429 *ppobj = NULL;
430 return E_OUTOFMEMORY;
432 track->UnknownVtbl = &DirectMusicChordTrack_Unknown_Vtbl;
433 track->TrackVtbl = &DirectMusicChordTrack_Track_Vtbl;
434 track->PersistStreamVtbl = &DirectMusicChordTrack_PersistStream_Vtbl;
435 track->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC));
436 DM_STRUCT_INIT(track->pDesc);
437 track->pDesc->dwValidData |= DMUS_OBJ_CLASS;
438 track->pDesc->guidClass = CLSID_DirectMusicChordTrack;
439 track->ref = 0; /* will be inited by QueryInterface */
441 return IDirectMusicChordTrack_IUnknown_QueryInterface ((LPUNKNOWN)&track->UnknownVtbl, lpcGUID, ppobj);