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
902B

  1. #pragma once
  2. #include "app/common.hpp"
  3. #include "widget/OpaqueWidget.hpp"
  4. #include "ui/Tooltip.hpp"
  5. #include "app/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. ParamQuantity *paramQuantity = NULL;
  12. float dirtyValue = NAN;
  13. ui::Tooltip *tooltip = NULL;
  14. ~ParamWidget();
  15. void step() override;
  16. void draw(const DrawArgs &args) override;
  17. void onButton(const widget::ButtonEvent &e) override;
  18. void onDoubleClick(const widget::DoubleClickEvent &e) override;
  19. void onEnter(const widget::EnterEvent &e) override;
  20. void onLeave(const widget::LeaveEvent &e) override;
  21. /** For legacy patch loading */
  22. void fromJson(json_t *rootJ);
  23. void createContextMenu();
  24. void resetAction();
  25. virtual void reset() {}
  26. virtual void randomize() {}
  27. };
  28. } // namespace app
  29. } // namespace rack