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.

29 lines
674B

  1. #pragma once
  2. #include "common.hpp"
  3. #include "engine.hpp"
  4. namespace rack {
  5. /** A Component which has control over a Param */
  6. struct ParamWidget : Component, QuantityWidget {
  7. int paramId;
  8. /** Used to momentarily disable value randomization
  9. To permanently disable or change randomization behavior, override the randomize() method instead of changing this.
  10. */
  11. bool randomizable = true;
  12. /** Apply per-sample smoothing in the engine */
  13. bool smooth = false;
  14. json_t *toJson();
  15. void fromJson(json_t *rootJ);
  16. virtual void reset();
  17. virtual void randomize();
  18. void onButton(event::Button &e) override;
  19. void onChange(event::Change &e) override;
  20. };
  21. } // namespace rack