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

- Fewer FIXMEs.

- Better traces. - IDirectMusicBand loading fixes: - load correctly instruments (and References - load IDirectMusicCollection object (using DMLoader) - insert the two on the list - IDirectMusicBandTrack loading fixes (fill OBJECTDESC and parse UNFO infos).
parent d40edb01
......@@ -360,7 +360,7 @@ static HRESULT IDirectMusicBandTrack_IPersistStream_ParseBandsList (LPPERSISTSTR
}
case FOURCC_RIFF: {
IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL);
FIXME_(dmfile)(": RIFF chunk of type %s (behavior to check)\n", debugstr_fourcc(Chunk.fccID));
TRACE_(dmfile)(": RIFF chunk of type %s\n", debugstr_fourcc(Chunk.fccID));
StreamSize = Chunk.dwSize - sizeof(FOURCC);
switch (Chunk.fccID) {
case DMUS_FOURCC_BAND_FORM: {
......@@ -444,6 +444,10 @@ static HRESULT IDirectMusicBandTrack_IPersistStream_ParseBandTrackForm (LPPERSIS
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
StreamCount += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize;
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
hr = IDirectMusicUtils_IPersistStream_ParseDescGeneric(&Chunk, pStm, This->pDesc);
if (FAILED(hr)) return hr;
switch (Chunk.fccID) {
case DMUS_FOURCC_BANDTRACK_CHUNK: {
TRACE_(dmfile)(": BandTrack chunk\n");
......@@ -457,6 +461,30 @@ static HRESULT IDirectMusicBandTrack_IPersistStream_ParseBandTrackForm (LPPERSIS
ListSize[0] = Chunk.dwSize - sizeof(FOURCC);
ListCount[0] = 0;
switch (Chunk.fccID) {
case DMUS_FOURCC_UNFO_LIST: {
TRACE_(dmfile)(": UNFO list\n");
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);
hr = IDirectMusicUtils_IPersistStream_ParseUNFOGeneric(&Chunk, pStm, This->pDesc);
if (FAILED(hr)) return hr;
if (hr == S_FALSE) {
switch (Chunk.fccID) {
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]);
break;
}
case DMUS_FOURCC_BANDS_LIST: {
TRACE_(dmfile)(": TRACK list\n");
hr = IDirectMusicBandTrack_IPersistStream_ParseBandsList (iface, &Chunk, pStm);
......@@ -493,7 +521,7 @@ HRESULT WINAPI IDirectMusicBandTrack_IPersistStream_Load (LPPERSISTSTREAM iface,
LARGE_INTEGER liMove;
HRESULT hr;
FIXME("(%p, %p): loading not fully implemented yet\n", This, pStm);
TRACE("(%p, %p): Loading\n", This, pStm);
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
......
......@@ -553,6 +553,25 @@ const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask) {
}
/* dump whole DMUS_OBJECTDESC struct */
void debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
if (pDesc) {
TRACE("DMUS_OBJECTDESC (%p):\n", pDesc);
TRACE(" - dwSize = %ld\n", pDesc->dwSize);
TRACE(" - dwValidData = %s\n", debugstr_DMUS_OBJ_FLAGS (pDesc->dwValidData));
if (pDesc->dwValidData & DMUS_OBJ_NAME) TRACE(" - wszName = %s\n", debugstr_w(pDesc->wszName));
if (pDesc->dwValidData & DMUS_OBJ_CLASS) TRACE(" - guidClass = %s\n", debugstr_dmguid(&pDesc->guidClass));
if (pDesc->dwValidData & DMUS_OBJ_OBJECT) TRACE(" - guidObject = %s\n", debugstr_guid(&pDesc->guidObject));
if (pDesc->dwValidData & DMUS_OBJ_DATE) TRACE(" - ftDate = FIXME\n");
if (pDesc->dwValidData & DMUS_OBJ_VERSION) TRACE(" - vVersion = %s\n", debugstr_dmversion(&pDesc->vVersion));
if (pDesc->dwValidData & DMUS_OBJ_CATEGORY) TRACE(" - wszCategory = %s\n", debugstr_w(pDesc->wszCategory));
if (pDesc->dwValidData & DMUS_OBJ_FILENAME) TRACE(" - wszFileName = %s\n", debugstr_w(pDesc->wszFileName));
if (pDesc->dwValidData & DMUS_OBJ_MEMORY) TRACE(" - llMemLength = %lli\n - pbMemData = %p\n", pDesc->llMemLength, pDesc->pbMemData);
if (pDesc->dwValidData & DMUS_OBJ_STREAM) TRACE(" - pStream = %p\n", pDesc->pStream);
} else {
TRACE("(NULL)\n");
}
}
/*
const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
if (pDesc) {
char buffer[1024] = "", *ptr = &buffer[0];
......@@ -574,4 +593,5 @@ const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc) {
} else {
return wine_dbg_sprintf("(NULL)");
}
}
}
*/
......@@ -234,6 +234,10 @@ extern const char *debugstr_dmreturn (DWORD code);
extern const char *debugstr_flags (DWORD flags, const flag_info* names, size_t num_names);
extern const char *debugstr_DMUS_OBJ_FLAGS (DWORD flagmask);
/* dump whole DMUS_OBJECTDESC struct */
extern const char *debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc);
extern void debugstr_DMUS_OBJECTDESC (LPDMUS_OBJECTDESC pDesc);
extern HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc);
extern HRESULT IDirectMusicUtils_IPersistStream_ParseUNFOGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc);
#endif /* __WINE_DMBAND_PRIVATE_H */
......@@ -750,7 +750,7 @@ static HRESULT IDirectMusicSegment8Impl_IPersistStream_ParseTrackForm (LPPERSIST
case FOURCC_RIFF: {
IStream_Read (pStm, &Chunk.fccID, sizeof(FOURCC), NULL);
FIXME_(dmfile)(": RIFF chunk of type %s (behavior to check)\n", debugstr_fourcc(Chunk.fccID));
TRACE_(dmfile)(": RIFF chunk of type %s\n", debugstr_fourcc(Chunk.fccID));
ListSize[0] = Chunk.dwSize - sizeof(FOURCC);
......@@ -1018,7 +1018,7 @@ HRESULT WINAPI IDirectMusicSegment8Impl_IPersistStream_Load (LPPERSISTSTREAM ifa
LARGE_INTEGER liMove; /* used when skipping chunks */
FIXME("(%p, %p): Loading not fully implemented yet\n", This, pStm);
TRACE("(%p, %p): Loading\n", This, pStm);
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
......
......@@ -383,7 +383,7 @@ static HRESULT IDirectMusicSegTriggerTrack_IPersistStream_ParseSegTrackList (LPP
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
switch (Chunk.fccID) {
case DMUS_FOURCC_SEGTRACK_CHUNK: {
FIXME_(dmfile)(": segment trigger track chunk\n");
TRACE_(dmfile)(": segment trigger track chunk\n");
liMove.QuadPart = Chunk.dwSize;
IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL);
break;
......@@ -429,7 +429,7 @@ HRESULT WINAPI IDirectMusicSegTriggerTrack_IPersistStream_Load (LPPERSISTSTREAM
LARGE_INTEGER liMove;
HRESULT hr;
FIXME("(%p, %p): Loading not fully implemented yet\n", This, pStm);
TRACE("(%p, %p): Loading\n", This, pStm);
#if 1
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
......
......@@ -262,7 +262,7 @@ static HRESULT IDirectMusicChordTrack_IPersistStream_ParseChordTrackList (LPPERS
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");
TRACE_(dmfile)(": Chord track header chunk\n");
IStream_Read (pStm, &This->dwScale, sizeof(DWORD), NULL);
TRACE_(dmfile)(" - dwScale: %ld\n", This->dwScale);
break;
......@@ -274,7 +274,7 @@ static HRESULT IDirectMusicChordTrack_IPersistStream_ParseChordTrackList (LPPERS
DMUS_IO_CHORD body;
DMUS_IO_SUBCHORD subchords;
FIXME_(dmfile)(": Chord track body chunk\n");
TRACE_(dmfile)(": Chord track body chunk\n");
IStream_Read (pStm, &sz, sizeof(DWORD), NULL);
TRACE_(dmfile)(" - sizeof(DMUS_IO_CHORD): %ld\n", sz);
......@@ -324,7 +324,7 @@ HRESULT WINAPI IDirectMusicChordTrack_IPersistStream_Load (LPPERSISTSTREAM iface
LARGE_INTEGER liMove;
HRESULT hr;
FIXME("(%p, %p): Loading not fully implemented yet\n", This, pStm);
TRACE("(%p, %p): Loading\n", This, pStm);
IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL);
TRACE_(dmfile)(": %s chunk (size = %ld)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize);
......
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