Commit a4215336 authored by Raphael Junqueira's avatar Raphael Junqueira Committed by Alexandre Julliard

- Typo fix in dmusicf.h.

- IDirectMusicChordTrack loading. - Many IsDirty and GetClassID stubs.
parent fd941d4d
/* DirectMusicInteractiveEngine Main
*
* Copyright (C) 2003-2004 Rok Mandeljc
* Copyright (C) 2003-2004 Raphael Junqueira
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -643,6 +643,8 @@ struct IDirectMusicSegTriggerTrack {
/* IDirectMusicSegTriggerTrack fields */
LPDMUS_OBJECTDESC pDesc;
DMUS_IO_SEGMENT_ITEM_HEADER header;
WCHAR wszName[DMUS_MAX_NAME];
};
/* IUnknown: */
......
/* IDirectMusicPerformance Implementation
*
* Copyright (C) 2003-2004 Rok Mandeljc
* Copyright (C) 2003-2004 Raphael Junqueira
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
/* IDirectMusicSegment8 Implementation
*
* Copyright (C) 2003-2004 Rok Mandeljc
* Copyright (C) 2003-2004 Raphael Junqueira
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -684,10 +685,10 @@ static HRESULT IDirectMusicSegment8Impl_IPersistStream_ParseTrackForm (LPPERSIST
case DMUS_FOURCC_TRACK_CHUNK: {
TRACE_(dmfile)(": track chunck\n");
IStream_Read (pStm, &track_hdr, sizeof(DMUS_IO_TRACK_HEADER), NULL);
TRACE_(dmfile)("class: %s\n", debugstr_guid (&track_hdr.guidClassID));
TRACE_(dmfile)("dwGroup: %ld\n", track_hdr.dwGroup);
TRACE_(dmfile)("ckid: %s\n", debugstr_fourcc (track_hdr.ckid));
TRACE_(dmfile)("fccType: %s\n", debugstr_fourcc (track_hdr.fccType));
TRACE_(dmfile)(" - class: %s\n", debugstr_guid (&track_hdr.guidClassID));
TRACE_(dmfile)(" - dwGroup: %ld\n", track_hdr.dwGroup);
TRACE_(dmfile)(" - ckid: %s\n", debugstr_fourcc (track_hdr.ckid));
TRACE_(dmfile)(" - fccType: %s\n", debugstr_fourcc (track_hdr.fccType));
break;
}
case DMUS_FOURCC_TRACK_EXTRAS_CHUNK: {
......
/* IDirectMusicSegTriggerTrack Implementation
*
* Copyright (C) 2003-2004 Rok Mandeljc
* Copyright (C) 2003-2004 Raphael Junqueira
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -225,8 +226,9 @@ ULONG WINAPI IDirectMusicSegTriggerTrack_IPersistStream_Release (LPPERSISTSTREAM
HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
ICOM_THIS_MULTI(IDirectMusicSegment8Impl, PersistStreamVtbl, iface);
FIXME("(%p, %p): stub\n", This, pClassID);
return E_NOTIMPL;
TRACE("(%p, %p)\n", This, pClassID);
memcpy(pClassID, &CLSID_DirectMusicSegTriggerTrack, sizeof(CLSID));
return S_OK;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
......@@ -256,14 +258,17 @@ static HRESULT IDirectMusicSegTriggerTrack_IPersistStream_ParseSegment (LPPERSIS
switch (Chunk.fccID) {
case DMUS_FOURCC_SEGMENTITEM_CHUNK: {
TRACE_(dmfile)(": segment item chunk\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
IStream_Read (pStm, &This->header, sizeof(DMUS_IO_SEGMENT_ITEM_HEADER), NULL);
TRACE_(dmfile)(" - lTimePhysical: %lu\n", This->header.lTimeLogical);
TRACE_(dmfile)(" - lTimePhysical: %lu\n", This->header.lTimePhysical);
TRACE_(dmfile)(" - dwPlayFlags: 0x%08lx\n", This->header.dwPlayFlags);
TRACE_(dmfile)(" - dwFlags: 0x%08lx\n", This->header.dwFlags);
break;
}
case DMUS_FOURCC_SEGMENTITEMNAME_CHUNK: {
TRACE_(dmfile)(": segment item name chunk\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
IStream_Read (pStm, This->wszName, Chunk.dwSize, NULL);
TRACE_(dmfile)(" - name: %s \n", debugstr_w(This->wszName));
break;
}
case FOURCC_LIST: {
......@@ -275,6 +280,12 @@ static HRESULT IDirectMusicSegTriggerTrack_IPersistStream_ParseSegment (LPPERSIS
/**
* should be a DMRF (DirectMusic Reference) list @TODO
*/
case DMUS_FOURCC_REF_LIST: {
FIXME_(dmfile)(": DMRF (DM References) list, not yet handled\n");
liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC);
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
default: {
TRACE_(dmfile)(": unknown (skipping)\n");
liMove.QuadPart = Chunk.dwSize - sizeof(FOURCC);
......@@ -359,7 +370,7 @@ static HRESULT IDirectMusicSegTriggerTrack_IPersistStream_ParseSegTrackList (LPP
LARGE_INTEGER liMove; /* used when skipping chunks */
if (pChunk->fccID != DMUS_FOURCC_SEGTRACK_LIST) {
ERR_(dmfile)(": %s chunk should be a TRACK list\n", debugstr_fourcc (pChunk->fccID));
ERR_(dmfile)(": %s chunk should be a SEGTRACK list\n", debugstr_fourcc (pChunk->fccID));
return E_FAIL;
}
......@@ -411,7 +422,6 @@ static HRESULT IDirectMusicSegTriggerTrack_IPersistStream_ParseSegTrackList (LPP
return S_OK;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, PersistStreamVtbl, iface);
......@@ -433,11 +443,6 @@ HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_Load (LPPERSISTSTREAM
TRACE_(dmfile)(": segment trigger track list\n");
hr = IDirectMusicSegTriggerTrack_IPersistStream_ParseSegTrackList (iface, &Chunk, pStm, This);
if (FAILED(hr)) return hr;
/*
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
*/
break;
}
default: {
......@@ -463,10 +468,14 @@ HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_Load (LPPERSISTSTREAM
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, PersistStreamVtbl, iface);
FIXME("(%p): Saving not implemented yet\n", This);
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
ICOM_THIS_MULTI(IDirectMusicSegTriggerTrack, PersistStreamVtbl, iface);
FIXME("(%p, %p): stub\n", This, pcbSize);
return E_NOTIMPL;
}
......
/* IDirectMusicScript
*
* Copyright (C) 2003-2004 Rok Mandeljc
* Copyright (C) 2003-2004 Raphael Junqueira
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -114,8 +115,8 @@ HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_CallRoutine (LPDIRECTMU
ICOM_THIS_MULTI(IDirectMusicScriptImpl, ScriptVtbl, iface);
FIXME("(%p, %s, %p): stub\n", This, debugstr_w(pwszRoutineName), pErrorInfo);
/*return E_NOTIMPL;*/
/*return S_OK;*/
return E_FAIL;
return S_OK;
/*return E_FAIL;*/
}
HRESULT WINAPI IDirectMusicScriptImpl_IDirectMusicScript_SetVariableVariant (LPDIRECTMUSICSCRIPT iface, WCHAR* pwszVariableName, VARIANT varValue, BOOL fSetRef, DMUS_SCRIPT_ERRORINFO* pErrorInfo) {
......@@ -417,11 +418,16 @@ ULONG WINAPI IDirectMusicScriptImpl_IPersistStream_Release (LPPERSISTSTREAM ifac
}
HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
ICOM_THIS_MULTI(IDirectMusicScriptImpl, PersistStreamVtbl, iface);
TRACE("(%p, %p)\n", This, pClassID);
memcpy(pClassID, &CLSID_DirectMusicScript, sizeof(CLSID));
return S_OK;
}
HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
ICOM_THIS_MULTI(IDirectMusicScriptImpl, PersistStreamVtbl, iface);
FIXME("(%p): stub, always S_FALSE\n", This);
return S_FALSE;
}
HRESULT WINAPI IDirectMusicScriptImpl_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
......
/* IDirectMusicChordTrack Implementation
*
* Copyright (C) 2003-2004 Rok Mandeljc
* Copyright (C) 2003-2004 Raphael Junqueira
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -88,8 +89,7 @@ ULONG WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Release (LPDIRECTMUSICTRAC
return IDirectMusicChordTrack_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl);
}
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment)
{
HRESULT WINAPI IDirectMusicChordTrack_IDirectMusicTrack_Init (LPDIRECTMUSICTRACK8 iface, IDirectMusicSegment* pSegment) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, TrackVtbl, iface);
FIXME("(%p, %p): stub\n", This, pSegment);
return S_OK;
......@@ -229,23 +229,146 @@ ULONG WINAPI IDirectMusicChordTrack_IPersistStream_Release (LPPERSISTSTREAM ifac
}
HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) {
return E_NOTIMPL;
ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
TRACE("(%p, %p)\n", This, pClassID);
memcpy(pClassID, &CLSID_DirectMusicChordTrack, sizeof(CLSID));
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_IsDirty (LPPERSISTSTREAM iface) {
return E_NOTIMPL;
ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
FIXME("(%p): stub, always S_FALSE\n", This);
return S_FALSE;
}
static HRESULT IDirectMusicChordTrack_IPersistStream_ParseChordTrackList (LPPERSISTSTREAM iface, DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, IDirectMusicChordTrack* This) {
DMUS_PRIVATE_CHUNK Chunk;
DWORD ListSize[3], ListCount[3];
LARGE_INTEGER liMove; /* used when skipping chunks */
if (pChunk->fccID != DMUS_FOURCC_CHORDTRACK_LIST) {
ERR_(dmfile)(": %s chunk should be a CHORDTRACK list\n", debugstr_fourcc (pChunk->fccID));
return E_FAIL;
}
ListSize[0] = pChunk->dwSize - sizeof(FOURCC);
ListCount[0] = 0;
do {
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case DMUS_FOURCC_CHORDTRACKHEADER_CHUNK: {
FIXME_(dmfile)(": Chord track header chunk\n");
IStream_Read (pStm, &This->dwScale, sizeof(DWORD), NULL);
TRACE_(dmfile)(" - dwScale: %ld\n", This->dwScale);
break;
}
case DMUS_FOURCC_CHORDTRACKBODY_CHUNK: {
DWORD sz;
DWORD it;
DWORD num;
DMUS_IO_CHORD body;
DMUS_IO_SUBCHORD subchords;
FIXME_(dmfile)(": Chord track body chunk\n");
IStream_Read (pStm, &sz, sizeof(DWORD), NULL);
TRACE_(dmfile)(" - sizeof(DMUS_IO_CHORD): %ld\n", sz);
if (sz != sizeof(DMUS_IO_CHORD)) return E_FAIL;
IStream_Read (pStm, &body, sizeof(DMUS_IO_CHORD), NULL);
TRACE_(dmfile)(" - wszName: %s\n", debugstr_w(body.wszName));
TRACE_(dmfile)(" - mtTime: %lu\n", body.mtTime);
TRACE_(dmfile)(" - wMeasure: %u\n", body.wMeasure);
TRACE_(dmfile)(" - bBeat: %u\n", body.bBeat);
TRACE_(dmfile)(" - bFlags: 0x%02x\n", body.bFlags);
IStream_Read (pStm, &num, sizeof(DWORD), NULL);
TRACE_(dmfile)(" - # DMUS_IO_SUBCHORDS: %ld\n", num);
IStream_Read (pStm, &sz, sizeof(DWORD), NULL);
TRACE_(dmfile)(" - sizeof(DMUS_IO_SUBCHORDS): %ld\n", sz);
if (sz != sizeof(DMUS_IO_SUBCHORD)) return E_FAIL;
for (it = 0; it < num; ++it) {
IStream_Read (pStm, &subchords, sizeof(DMUS_IO_SUBCHORD), NULL);
TRACE_(dmfile)("DMUS_IO_SUBCHORD #%ld\n", it);
TRACE_(dmfile)(" - dwChordPattern: %lu\n", subchords.dwChordPattern);
TRACE_(dmfile)(" - dwScalePattern: %lu\n", subchords.dwScalePattern);
TRACE_(dmfile)(" - dwInversionPoints: %lu\n", subchords.dwInversionPoints);
TRACE_(dmfile)(" - dwLevels: %lu\n", subchords.dwLevels);
TRACE_(dmfile)(" - bChordRoot: %u\n", subchords.bChordRoot);
TRACE_(dmfile)(" - bScaleRoot: %u\n", subchords.bScaleRoot);
}
break;
}
default: {
TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
}
}
TRACE_(dmfile)(": ListCount[0] = %ld < ListSize[0] = %ld\n", ListCount[0], ListSize[0]);
} while (ListCount[0] < ListSize[0]);
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_Load (LPPERSISTSTREAM iface, IStream* pStm) {
FIXME(": Loading not implemented yet\n");
ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
DMUS_PRIVATE_CHUNK Chunk;
LARGE_INTEGER liMove;
HRESULT hr;
FIXME(": Loading not fully implemented yet\n");
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case FOURCC_LIST: {
IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case DMUS_FOURCC_CHORDTRACK_LIST: {
TRACE_(dmfile)(": Chord track list\n");
hr = IDirectMusicChordTrack_IPersistStream_ParseChordTrackList (iface, &Chunk, pStm, This);
if (FAILED(hr)) return hr;
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
return E_FAIL;
}
}
TRACE_(dmfile)(": reading finished\n");
break;
}
default: {
TRACE_(dmfile)(": unexpected chunk; loading failed)\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); /* skip the rest of the chunk */
return E_FAIL;
}
}
return S_OK;
}
HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_Save (LPPERSISTSTREAM iface, IStream* pStm, BOOL fClearDirty) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
FIXME("(%p): Saving not implemented yet\n", This);
return E_NOTIMPL;
}
HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_GetSizeMax (LPPERSISTSTREAM iface, ULARGE_INTEGER* pcbSize) {
ICOM_THIS_MULTI(IDirectMusicChordTrack, PersistStreamVtbl, iface);
FIXME("(%p, %p): stub\n", This, pcbSize);
return E_NOTIMPL;
}
......
......@@ -214,6 +214,7 @@ struct IDirectMusicChordTrack {
/* IDirectMusicChordTrack fields */
LPDMUS_OBJECTDESC pDesc;
DWORD dwScale;
};
/* IUnknown: */
......
......@@ -829,7 +829,7 @@ struct _DMUS_IO_SEGMENT_TRACK_HEADER {
};
struct _DMUS_IO_SEGMENT_ITEM_HEADER {
MUSIC_TIME llTimeLogical;
MUSIC_TIME lTimeLogical;
MUSIC_TIME lTimePhysical;
DWORD dwPlayFlags;
DWORD dwFlags;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment