dmband: Handle the DirectX 7 version of DMUS_IO_INSTRUMENT structure.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Signed-off-by: Michael Stefaniuc <mstefani@winehq.org> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e4a5af6c0d
commit
070cfc358c
|
@ -171,6 +171,8 @@ static const IDirectMusicObjectVtbl dmobject_vtbl = {
|
|||
band_IDirectMusicObject_ParseDescriptor
|
||||
};
|
||||
|
||||
#define DMUS_IO_INSTRUMENT_DX7_SIZE offsetof(DMUS_IO_INSTRUMENT, nPitchBendRange)
|
||||
|
||||
/* IDirectMusicBandImpl IPersistStream part: */
|
||||
static HRESULT parse_instrument(IDirectMusicBandImpl *This, DMUS_PRIVATE_CHUNK *pChunk,
|
||||
IStream *pStm)
|
||||
|
@ -199,8 +201,14 @@ static HRESULT parse_instrument(IDirectMusicBandImpl *This, DMUS_PRIVATE_CHUNK *
|
|||
switch (Chunk.fccID) {
|
||||
case DMUS_FOURCC_INSTRUMENT_CHUNK: {
|
||||
TRACE_(dmfile)(": Instrument chunk\n");
|
||||
if (Chunk.dwSize != sizeof(DMUS_IO_INSTRUMENT)) return E_FAIL;
|
||||
IStream_Read (pStm, &inst, sizeof(DMUS_IO_INSTRUMENT), NULL);
|
||||
if (Chunk.dwSize != sizeof(DMUS_IO_INSTRUMENT) && Chunk.dwSize != DMUS_IO_INSTRUMENT_DX7_SIZE) {
|
||||
ERR_(dmfile)("unexpected size %d\n", Chunk.dwSize);
|
||||
return E_FAIL;
|
||||
}
|
||||
IStream_Read (pStm, &inst, Chunk.dwSize, NULL);
|
||||
if (Chunk.dwSize != sizeof(DMUS_IO_INSTRUMENT))
|
||||
inst.nPitchBendRange = 0;
|
||||
|
||||
TRACE_(dmfile)(" - dwPatch: %u\n", inst.dwPatch);
|
||||
TRACE_(dmfile)(" - dwAssignPatch: %u\n", inst.dwAssignPatch);
|
||||
TRACE_(dmfile)(" - dwNoteRanges[0]: %u\n", inst.dwNoteRanges[0]);
|
||||
|
|
Loading…
Reference in New Issue