the handleGroupOpcode logic was flawed

This commit is contained in:
Paul Ferrand 2020-03-29 00:49:55 +01:00
parent 42720109a7
commit 5ef9d6e996

View file

@ -180,7 +180,7 @@ void sfz::Synth::handleGlobalOpcodes(const std::vector<Opcode>& members)
void sfz::Synth::handleGroupOpcodes(const std::vector<Opcode>& members) void sfz::Synth::handleGroupOpcodes(const std::vector<Opcode>& members)
{ {
absl::optional<unsigned> groupIdx; absl::optional<unsigned> groupIdx;
absl::optional<unsigned> maxPolyphony; unsigned maxPolyphony { config::maxVoices };
for (auto& member : members) { for (auto& member : members) {
switch (member.lettersOnlyHash) { switch (member.lettersOnlyHash) {
@ -193,8 +193,8 @@ void sfz::Synth::handleGroupOpcodes(const std::vector<Opcode>& members)
} }
} }
if (groupIdx && maxPolyphony) if (groupIdx)
setGroupPolyphony(*groupIdx, *maxPolyphony); setGroupPolyphony(*groupIdx, maxPolyphony);
} }
void sfz::Synth::handleControlOpcodes(const std::vector<Opcode>& members) void sfz::Synth::handleControlOpcodes(const std::vector<Opcode>& members)