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.

39 lines
867B

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