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.

32 lines
490B

  1. #include "app.hpp"
  2. #include "engine.hpp"
  3. namespace rack {
  4. json_t *ParamWidget::toJson() {
  5. json_t *paramJ = json_real(value);
  6. return paramJ;
  7. }
  8. void ParamWidget::fromJson(json_t *root) {
  9. setValue(json_number_value(root));
  10. }
  11. void ParamWidget::onMouseDown(int button) {
  12. if (button == 1) {
  13. setValue(defaultValue);
  14. }
  15. }
  16. void ParamWidget::onChange() {
  17. if (!module)
  18. return;
  19. // module->params[paramId] = value;
  20. engineSetParamSmooth(module, paramId, value);
  21. }
  22. } // namespace rack