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.

SvgSwitch.hpp 684B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include <app/common.hpp>
  3. #include <widget/FramebufferWidget.hpp>
  4. #include <widget/SvgWidget.hpp>
  5. #include <app/CircularShadow.hpp>
  6. #include <app/Switch.hpp>
  7. namespace rack {
  8. namespace app {
  9. /** A ParamWidget with multiple frames corresponding to its value */
  10. struct SvgSwitch : Switch {
  11. widget::FramebufferWidget* fb;
  12. CircularShadow* shadow;
  13. widget::SvgWidget* sw;
  14. std::vector<std::shared_ptr<Svg>> frames;
  15. SvgSwitch();
  16. /** Adds an SVG file to represent the next switch position */
  17. void addFrame(std::shared_ptr<Svg> svg);
  18. void onChange(const event::Change& e) override;
  19. };
  20. DEPRECATED typedef SvgSwitch SVGSwitch;
  21. } // namespace app
  22. } // namespace rack