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.

25 lines
580B

  1. #pragma once
  2. #include "app/common.hpp"
  3. namespace rack {
  4. /** Behaves like a knob but linearly moves an SVGWidget between two points.
  5. Can be used for horizontal or vertical linear faders.
  6. */
  7. struct SVGSlider : Knob, FramebufferWidget {
  8. SVGWidget *background;
  9. SVGWidget *handle;
  10. /** Intermediate positions will be interpolated between these positions */
  11. Vec minHandlePos, maxHandlePos;
  12. SVGSlider();
  13. void setSVGs(std::shared_ptr<SVG> backgroundSVG, std::shared_ptr<SVG> handleSVG);
  14. void step() override;
  15. void onChange(event::Change &e) override;
  16. };
  17. } // namespace rack