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.

21 lines
441B

  1. #include "rack.hpp"
  2. #include "ui.hpp"
  3. #include "ParamFloatField.hpp"
  4. ParamFloatField::ParamFloatField(Module *_module)
  5. {
  6. module = _module;
  7. }
  8. void ParamFloatField::setValue(float value) {
  9. this->hovered_value = value;
  10. // this->module->param_value = value;
  11. EventChange e;
  12. onChange(e);
  13. }
  14. void ParamFloatField::onChange(EventChange &e) {
  15. std::string new_text = stringf("%#.4g", hovered_value);
  16. setText(new_text);
  17. }