We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 359c215 commit 455982bCopy full SHA for 455982b
1 file changed
FaustCode/owl.cpp
@@ -358,15 +358,8 @@ class OwlCheckbox : public OwlParameterBase {
358
, fButton(button) {}
359
void update() {
360
bool isHigh = fPatch->isButtonPressed(fButton);
361
- if (isHigh && !wasHigh) {
362
- // Rising edge detected
363
- state = !state;
364
- wasHigh = true;
365
- }
366
- else if (!isHigh && wasHigh) {
367
- // Falling edge detected
368
- wasHigh = false;
369
+ state ^= isHigh && !wasHigh;
+ wasHigh = isHigh;
370
fPatch->setButton(fButton, state, 0);
371
*fZone = state;
372
}
0 commit comments