You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
592B

  1. #pragma once
  2. #include "app/common.hpp"
  3. #include "app/ParamWidget.hpp"
  4. namespace rack {
  5. namespace app {
  6. /** A ParamWidget that controls */
  7. struct Switch : ParamWidget {
  8. /** Return to original position when released */
  9. bool momentary = false;
  10. /** Hysteresis state for momentary switch */
  11. bool momentaryPressed = false;
  12. bool momentaryReleased = false;
  13. void step() override;
  14. void onDoubleClick(const event::DoubleClick &e) override;
  15. void onDragStart(const event::DragStart &e) override;
  16. void onDragEnd(const event::DragEnd &e) override;
  17. };
  18. } // namespace app
  19. } // namespace rack