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 564B

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