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.

24 lines
498B

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