summaryrefslogtreecommitdiff
path: root/ZAPDTR
diff options
context:
space:
mode:
authorNicholas Estelami <NEstelami@users.noreply.github.com>2022-06-14 00:59:31 -0400
committerNicholas Estelami <NEstelami@users.noreply.github.com>2022-06-15 15:57:52 -0400
commit416173fa79b77ddbdb6a9870528db10bfa4cd21a (patch)
tree3e31f54abd3119fd4e96b2deb8e8ce3d3ff73be0 /ZAPDTR
parent99e3d9a8992fa722ddf1af6ef52b3a01bebba4c7 (diff)
Added names for the soundfonts.
Diffstat (limited to 'ZAPDTR')
-rw-r--r--ZAPDTR/ZAPD/ZAudio.cpp13
-rw-r--r--ZAPDTR/ZAPD/ZAudio.h1
2 files changed, 9 insertions, 5 deletions
diff --git a/ZAPDTR/ZAPD/ZAudio.cpp b/ZAPDTR/ZAPD/ZAudio.cpp
index 976133513..a502a0545 100644
--- a/ZAPDTR/ZAPD/ZAudio.cpp
+++ b/ZAPDTR/ZAPD/ZAudio.cpp
@@ -68,6 +68,13 @@ void ZAudio::ParseXML(tinyxml2::XMLElement* reader)
}
}
+ if (std::string(child->Value()) == "Soundfont")
+ {
+ auto name = child->Attribute("Name");
+ auto index = child->IntAttribute("Index", 0);
+ soundFontNames[index] = name;
+ }
+
child = child->NextSiblingElement();
}
}
@@ -154,14 +161,10 @@ SampleEntry* ZAudio::ParseSampleEntry(std::vector<uint8_t> audioBank,
int bp = 0;
}
- if (/* sample->loop.count != 0xFFFFFFFF && */ sample->loop.count != 0)
+ if (sample->loop.count != 0)
{
- //for (int i = 0; i < sample->loop.count; i++)
for (int i = 0; i < 16; i++)
{
- //if ((loopOffset + 16 + (i * 2)) >= audioBank.size())
- //break;
-
int16_t state = BitConverter::ToInt16BE(audioBank, loopOffset + 16 + (i * 2));
sample->loop.states.push_back(state);
}
diff --git a/ZAPDTR/ZAPD/ZAudio.h b/ZAPDTR/ZAPD/ZAudio.h
index 511ba5ed6..286c75c11 100644
--- a/ZAPDTR/ZAPD/ZAudio.h
+++ b/ZAPDTR/ZAPD/ZAudio.h
@@ -95,6 +95,7 @@ public:
std::map<uint32_t, SampleEntry*> samples;
std::vector<std::vector<uint32_t>> fontIndices;
std::vector<std::string> seqNames;
+ std::map<uint32_t, std::string> soundFontNames;
// First Key = Bank ID, Sec Key = LoopDataOffset, Third Key = Sample Data Offset
std::map<uint32_t, std::map<uint32_t, std::map<uint32_t, std::string>>> sampleOffsets;