This commit is contained in:
Paul Ferrand 2021-02-04 21:40:21 +01:00
parent dc68054981
commit acb860e984
3 changed files with 4 additions and 16 deletions

View file

@ -170,10 +170,7 @@ bool sfz::Region::parseOpcode(const Opcode& rawOpcode)
group = opcode.read(Default::group); group = opcode.read(Default::group);
break; break;
case hash("off_by"): // also offby case hash("off_by"): // also offby
if (opcode.value == "-1") offBy = opcode.readOptional(Default::group);
offBy.reset();
else
offBy = opcode.read(Default::group);
break; break;
case hash("off_mode"): // also offmode case hash("off_mode"): // also offmode
offMode = opcode.read(Default::offMode); offMode = opcode.read(Default::offMode);
@ -189,16 +186,7 @@ bool sfz::Region::parseOpcode(const Opcode& rawOpcode)
notePolyphony = opcode.read(Default::notePolyphony); notePolyphony = opcode.read(Default::notePolyphony);
break; break;
case hash("note_selfmask"): case hash("note_selfmask"):
switch (hash(opcode.value)) { selfMask = opcode.read(Default::selfMask);
case hash("on"):
selfMask = SelfMask::mask;
break;
case hash("off"):
selfMask = SelfMask::dontMask;
break;
default:
DBG("Unkown self mask value:" << opcode.value);
}
break; break;
case hash("rt_dead"): case hash("rt_dead"):
rtDead = opcode.read(Default::rtDead); rtDead = opcode.read(Default::rtDead);

View file

@ -474,7 +474,7 @@ struct Region {
bool bpmSwitched { true }; bool bpmSwitched { true };
bool aftertouchSwitched { true }; bool aftertouchSwitched { true };
std::bitset<config::numCCs> ccSwitched; std::bitset<config::numCCs> ccSwitched;
absl::string_view defaultPath { "" }; std::string defaultPath { "" };
int sequenceCounter { 0 }; int sequenceCounter { 0 };
LEAK_DETECTOR(Region); LEAK_DETECTOR(Region);

View file

@ -2291,7 +2291,7 @@ TEST_CASE("[Values] Self-mask")
"/region0/note_selfmask,T : { }", "/region0/note_selfmask,T : { }",
"/region1/note_selfmask,F : { }", "/region1/note_selfmask,F : { }",
"/region2/note_selfmask,T : { }", "/region2/note_selfmask,T : { }",
"/region3/note_selfmask,F : { }", "/region3/note_selfmask,T : { }",
}; };
REQUIRE(messageList == expected); REQUIRE(messageList == expected);
} }