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

  1. #pragma once
  2. #include "ui/Quantity.hpp"
  3. #include "engine/Module.hpp"
  4. #include "engine/Param.hpp"
  5. namespace rack {
  6. namespace app {
  7. /** A ui::Quantity that wraps an engine Param */
  8. struct ParamQuantity : ui::Quantity {
  9. engine::Module *module = NULL;
  10. int paramId = 0;
  11. engine::Param *getParam();
  12. /** Request to the engine to smoothly set the value */
  13. void setSmoothValue(float smoothValue);
  14. float getSmoothValue();
  15. void setValue(float value) override;
  16. float getValue() override;
  17. float getMinValue() override;
  18. float getMaxValue() override;
  19. float getDefaultValue() override;
  20. float getDisplayValue() override;
  21. void setDisplayValue(float displayValue) override;
  22. std::string getDisplayValueString() override;
  23. void setDisplayValueString(std::string s) override;
  24. int getDisplayPrecision() override;
  25. std::string getLabel() override;
  26. std::string getUnit() override;
  27. };
  28. } // namespace app
  29. } // namespace rack