Add MIDI-setup reading

This commit is contained in:
Jack Andersen 2016-05-09 19:52:19 -10:00
parent 04382030a1
commit 60f873e76e
2 changed files with 12 additions and 1 deletions

View File

@ -35,7 +35,7 @@ struct SongGroupIndex : AudioGroupIndex
uint8_t reverb;
uint8_t chorus;
};
std::unordered_map<int, std::array<const MIDISetup*, 16>> m_midiSetups;
std::unordered_map<int, const std::array<MIDISetup, 16>*> m_midiSetups;
};
/** Root index of SFXGroup */

View File

@ -70,6 +70,17 @@ AudioGroupProject::AudioGroupProject(const unsigned char* data)
idx.m_drumPages[drumEntries->programNo] = drumEntries;
++drumEntries;
}
/* MIDI setups */
const uint8_t* setupData = data + header.midiSetupsOff;
const uint8_t* setupEnd = data + header.groupEndOff;
while (setupData < setupEnd)
{
uint32_t songId = SBig(*reinterpret_cast<const uint32_t*>(setupData));
idx.m_midiSetups[songId] =
reinterpret_cast<const std::array<SongGroupIndex::MIDISetup, 16>*>(setupData + 4);
setupData += 5 * 16 + 4;
}
}
else if (header.type == GroupType::SFX)
{