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.

37 lines
807B

  1. #pragma once
  2. #include "ui/Quantity.hpp"
  3. #include "engine/Module.hpp"
  4. #include "engine/Param.hpp"
  5. namespace rack {
  6. /** A Quantity that wraps an engine Param */
  7. struct ParamQuantity : Quantity {
  8. Module *module = NULL;
  9. int paramId = 0;
  10. /** Use engine smoothing of Param values */
  11. bool smooth = false;
  12. /** Snap to the nearest integer */
  13. bool snap = false;
  14. float snapValue = 0.f;
  15. Param *getParam();
  16. void commitSnap();
  17. void setValue(float value) override;
  18. float getValue() override;
  19. float getMinValue() override;
  20. float getMaxValue() override;
  21. float getDefaultValue() override;
  22. float getDisplayValue() override;
  23. void setDisplayValue(float displayValue) override;
  24. int getDisplayPrecision() override;
  25. std::string getLabel() override;
  26. std::string getUnit() override;
  27. };
  28. } // namespace rack