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.

SvgKnob.hpp 772B

12345678910111213141516171819202122232425262728293031323334353637
  1. #pragma once
  2. #include <app/common.hpp>
  3. #include <app/Knob.hpp>
  4. #include <widget/FramebufferWidget.hpp>
  5. #include <widget/TransformWidget.hpp>
  6. #include <widget/SvgWidget.hpp>
  7. #include <app/CircularShadow.hpp>
  8. namespace rack {
  9. namespace app {
  10. /** A knob which rotates an SVG and caches it in a framebuffer */
  11. struct SvgKnob : Knob {
  12. widget::FramebufferWidget* fb;
  13. CircularShadow* shadow;
  14. widget::TransformWidget* tw;
  15. widget::SvgWidget* sw;
  16. /** Angles in radians */
  17. float minAngle = 0.f;
  18. float maxAngle = M_PI;
  19. SvgKnob();
  20. void setSvg(std::shared_ptr<Svg> svg);
  21. DEPRECATED void setSVG(std::shared_ptr<Svg> svg) {
  22. setSvg(svg);
  23. }
  24. void onChange(const event::Change& e) override;
  25. };
  26. DEPRECATED typedef SvgKnob SVGKnob;
  27. } // namespace app
  28. } // namespace rack