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.

36 lines
820B

  1. #pragma once
  2. #include <app/common.hpp>
  3. #include <widget/OpaqueWidget.hpp>
  4. #include <ui/Tooltip.hpp>
  5. #include <engine/ParamQuantity.hpp>
  6. #include <history.hpp>
  7. namespace rack {
  8. namespace app {
  9. /** Manages an engine::Param on a ModuleWidget. */
  10. struct ParamWidget : widget::OpaqueWidget {
  11. engine::ParamQuantity* paramQuantity = NULL;
  12. ui::Tooltip* tooltip = NULL;
  13. /** For triggering the Change event. `*/
  14. float lastValue = NAN;
  15. virtual void init() {}
  16. void step() override;
  17. void draw(const DrawArgs& args) override;
  18. void onButton(const event::Button& e) override;
  19. void onDoubleClick(const event::DoubleClick& e) override;
  20. void onEnter(const event::Enter& e) override;
  21. void onLeave(const event::Leave& e) override;
  22. void createContextMenu();
  23. void resetAction();
  24. };
  25. } // namespace app
  26. } // namespace rack