Skip to content

Commit

Permalink
Display playing note when no notes are enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
strongheart1 committed Jun 1, 2022
1 parent 224c46f commit 7ca0ed5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Quantizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ struct PianoNote : OpaqueWidget {
kInit,
kDisabled,
kEnabledNotPlaying,
kEnabledAndPlaying
kPlaying
} state = kInit;

int note;
Expand Down Expand Up @@ -182,7 +182,7 @@ struct PianoNote : OpaqueWidget {
for (int i=0; i<2; ++i) {
if (shapes[i] == nullptr)
break;
shapes[i]->opacity = state == kDisabled ? 0.f : opacities[i] * (state == kEnabledAndPlaying ? 1.f : 0.5f);
shapes[i]->opacity = state == kDisabled ? 0.f : opacities[i] * (state == kPlaying ? 1.f : 0.5f);
}
if (svgFb != nullptr)
svgFb->setDirty();
Expand Down Expand Up @@ -211,8 +211,8 @@ struct PianoNote : OpaqueWidget {
return;
}

const State newstate = !module->enabledNotes[note] ? kDisabled
: module->playingNotes[note] ? kEnabledAndPlaying : kEnabledNotPlaying;
const State newstate = module->playingNotes[note] ? kPlaying
: module->enabledNotes[note] ? kEnabledNotPlaying : kDisabled;

if (newstate != state) {
state = newstate;
Expand Down

0 comments on commit 7ca0ed5

Please sign in to comment.