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

View file

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

View file

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