| 461 | } |
| 462 | |
| 463 | void onDragMove(const event::DragMove& e) override { |
| 464 | if (e.button == GLFW_MOUSE_BUTTON_LEFT) { |
| 465 | pos += e.mouseDelta; |
| 466 | |
| 467 | // Once the user has dragged the mouse a "threshold" distance, latch |
| 468 | // to disallow further changes of state until the mouse is released. |
| 469 | // We don't just setValue(1) (default/rest state) because this creates a |
| 470 | // jarring UI experience |
| 471 | if (pos.y < -10 && !latched) { |
| 472 | getParamQuantity()->setValue(StereoStrip::MUTE_OFF); |
| 473 | latched = true; |
| 474 | } |
| 475 | if (pos.y > 10 && !latched) { |
| 476 | getParamQuantity()->setValue(StereoStrip::MUTE_OFF_MOMENTARY); |
| 477 | latched = true; |
| 478 | } |
| 479 | } |
| 480 | ParamWidget::onDragMove(e); |
| 481 | } |
| 482 | |
| 483 | void onDragEnd(const event::DragEnd& e) override { |
| 484 | if (e.button == GLFW_MOUSE_BUTTON_LEFT) { |