Added a switched on check for CC events in the regions
This commit is contained in:
parent
0147546f6a
commit
18cc80f344
1 changed files with 4 additions and 2 deletions
|
|
@ -539,12 +539,14 @@ bool sfz::Region::registerCC(int channel, int ccNumber, uint8_t ccValue) noexcep
|
||||||
if (!channelRange.containsWithEnd(channel))
|
if (!channelRange.containsWithEnd(channel))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// TODO: we can probably
|
|
||||||
if (ccConditions.getWithDefault(ccNumber).containsWithEnd(ccValue))
|
if (ccConditions.getWithDefault(ccNumber).containsWithEnd(ccValue))
|
||||||
ccSwitched.set(ccNumber, true);
|
ccSwitched.set(ccNumber, true);
|
||||||
else
|
else
|
||||||
ccSwitched.set(ccNumber, false);
|
ccSwitched.set(ccNumber, false);
|
||||||
|
|
||||||
|
if (!isSwitchedOn())
|
||||||
|
return false;
|
||||||
|
|
||||||
if (ccTriggers.contains(ccNumber) && ccTriggers.at(ccNumber).containsWithEnd(ccValue))
|
if (ccTriggers.contains(ccNumber) && ccTriggers.at(ccNumber).containsWithEnd(ccValue))
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
|
|
@ -684,7 +686,7 @@ float sfz::Region::getNoteGain(int noteNumber, uint8_t velocity) noexcept
|
||||||
float sfz::Region::getCCGain(const sfz::CCValueArray& ccState) noexcept
|
float sfz::Region::getCCGain(const sfz::CCValueArray& ccState) noexcept
|
||||||
{
|
{
|
||||||
float gain { 1.0f };
|
float gain { 1.0f };
|
||||||
|
|
||||||
// Crossfades due to CC states
|
// Crossfades due to CC states
|
||||||
for (const auto& valuePair : crossfadeCCInRange) {
|
for (const auto& valuePair : crossfadeCCInRange) {
|
||||||
const auto ccValue = ccState[valuePair.first];
|
const auto ccValue = ccState[valuePair.first];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue