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.

65 lines
1.3KB

  1. #include "rack.hpp"
  2. using namespace rack;
  3. // Forward-declare the Plugin, defined in Template.cpp
  4. #define plugin "21kHz"
  5. ////////////////////////////////
  6. // Knobs
  7. struct kHzKnob : RoundKnob {
  8. kHzKnob() {
  9. setSVG(SVG::load(assetPlugin(plugin, "res/Components/kHzKnob.svg")));
  10. shadow->box.pos = Vec(0.0, 3.5);
  11. }
  12. };
  13. struct kHzKnobSmall : RoundKnob {
  14. kHzKnobSmall() {
  15. setSVG(SVG::load(assetPlugin(plugin, "res/Components/kHzKnobSmall.svg")));
  16. shadow->box.pos = Vec(0.0, 2.5);
  17. }
  18. };
  19. struct kHzKnobSnap : kHzKnob {
  20. kHzKnobSnap() {
  21. snap = true;
  22. }
  23. };
  24. struct kHzKnobSmallSnap : kHzKnobSmall {
  25. kHzKnobSmallSnap() {
  26. snap = true;
  27. }
  28. };
  29. // Buttons
  30. struct kHzButton : SVGSwitch, ToggleSwitch {
  31. kHzButton() {
  32. addFrame(SVG::load(assetPlugin(plugin, "res/Components/kHzButton_0.svg")));
  33. addFrame(SVG::load(assetPlugin(plugin, "res/Components/kHzButton_1.svg")));
  34. }
  35. };
  36. // Ports
  37. struct kHzPort : SVGPort {
  38. kHzPort() {
  39. setSVG(SVG::load(assetPlugin(plugin, "res/Components/kHzPort.svg")));
  40. shadow->box.pos = Vec(0.0, 2.0);
  41. }
  42. };
  43. // Misc
  44. struct kHzScrew : SVGScrew {
  45. kHzScrew() {
  46. sw->setSVG(SVG::load(assetPlugin(plugin, "res/Components/kHzScrew.svg")));
  47. }
  48. };