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.

38 lines
873B

  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. float dirtyValue = NAN;
  13. ui::Tooltip* tooltip = NULL;
  14. void step() override;
  15. void draw(const DrawArgs& args) override;
  16. void onButton(const event::Button& e) override;
  17. void onDoubleClick(const event::DoubleClick& e) override;
  18. void onEnter(const event::Enter& e) override;
  19. void onLeave(const event::Leave& e) override;
  20. /** For legacy patch loading */
  21. void fromJson(json_t* rootJ);
  22. void createContextMenu();
  23. void resetAction();
  24. virtual void reset() {}
  25. virtual void randomize() {}
  26. };
  27. } // namespace app
  28. } // namespace rack