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.

93 lines
4.4KB

  1. #include "../controller/1x8CV.hpp"
  2. #include "../../deps/rack-components/jacks.hpp"
  3. #include "../../deps/rack-components/screws.hpp"
  4. namespace rack_plugin_SynthKit {
  5. struct M1x8CVWidget : ModuleWidget {
  6. M1x8CVWidget(M1x8CVModule *module);
  7. };
  8. M1x8CVWidget::M1x8CVWidget(M1x8CVModule *module) : ModuleWidget(module) {
  9. box.size = Vec(4 * RACK_GRID_WIDTH, RACK_GRID_HEIGHT);
  10. {
  11. SVGPanel *panel = new SVGPanel();
  12. panel->box.size = box.size;
  13. panel->setBackground(SVG::load(assetPlugin(plugin, "res/1x8CV.svg")));
  14. addChild(panel);
  15. }
  16. addChild(Widget::create<JLHHexScrew>(Vec(1, 1)));
  17. addChild(Widget::create<JLHHexScrew>(Vec(46, 366)));
  18. addInput(Port::create<RCJackSmallLight>(Vec(17.73, 73), Port::INPUT, module,
  19. M1x8CVModule::TOP_INPUT));
  20. addInput(Port::create<RCJackSmallLight>(Vec(0.48, 158), Port::INPUT, module,
  21. M1x8CVModule::FIRST_CV));
  22. addOutput(Port::create<RCJackSmallDark>(Vec(25.23, 158), Port::OUTPUT, module,
  23. M1x8CVModule::FIRST_OUTPUT));
  24. addChild(ModuleLightWidget::create<SmallLight<GreenLight>>(
  25. Vec(51.5, 167.06), module, M1x8CVModule::FIRST_LED));
  26. addInput(Port::create<RCJackSmallLight>(Vec(0.48, 179), Port::INPUT, module,
  27. M1x8CVModule::SECOND_CV));
  28. addOutput(Port::create<RCJackSmallDark>(Vec(25.23, 179), Port::OUTPUT, module,
  29. M1x8CVModule::SECOND_OUTPUT));
  30. addChild(ModuleLightWidget::create<SmallLight<GreenLight>>(
  31. Vec(51.5, 188.06), module, M1x8CVModule::SECOND_LED));
  32. addInput(Port::create<RCJackSmallLight>(Vec(0.48, 200), Port::INPUT, module,
  33. M1x8CVModule::THIRD_CV));
  34. addOutput(Port::create<RCJackSmallDark>(Vec(25.23, 200), Port::OUTPUT, module,
  35. M1x8CVModule::THIRD_OUTPUT));
  36. addChild(ModuleLightWidget::create<SmallLight<GreenLight>>(
  37. Vec(51.5, 209.06), module, M1x8CVModule::THIRD_LED));
  38. addInput(Port::create<RCJackSmallLight>(Vec(0.48, 221), Port::INPUT, module,
  39. M1x8CVModule::FOURTH_CV));
  40. addOutput(Port::create<RCJackSmallDark>(Vec(25.23, 221), Port::OUTPUT, module,
  41. M1x8CVModule::FOURTH_OUTPUT));
  42. addChild(ModuleLightWidget::create<SmallLight<GreenLight>>(
  43. Vec(51.5, 230.06), module, M1x8CVModule::FOURTH_LED));
  44. addInput(Port::create<RCJackSmallLight>(Vec(0.48, 242), Port::INPUT, module,
  45. M1x8CVModule::FIFTH_CV));
  46. addOutput(Port::create<RCJackSmallDark>(Vec(25.23, 242), Port::OUTPUT, module,
  47. M1x8CVModule::FIFTH_OUTPUT));
  48. addChild(ModuleLightWidget::create<SmallLight<GreenLight>>(
  49. Vec(51.5, 251.06), module, M1x8CVModule::FIFTH_LED));
  50. addInput(Port::create<RCJackSmallLight>(Vec(0.48, 263), Port::INPUT, module,
  51. M1x8CVModule::SIXTH_CV));
  52. addOutput(Port::create<RCJackSmallDark>(Vec(25.23, 263), Port::OUTPUT, module,
  53. M1x8CVModule::SIXTH_OUTPUT));
  54. addChild(ModuleLightWidget::create<SmallLight<GreenLight>>(
  55. Vec(51.5, 272.06), module, M1x8CVModule::SIXTH_LED));
  56. addInput(Port::create<RCJackSmallLight>(Vec(0.48, 284), Port::INPUT, module,
  57. M1x8CVModule::SEVENTH_CV));
  58. addOutput(Port::create<RCJackSmallDark>(Vec(25.23, 284), Port::OUTPUT, module,
  59. M1x8CVModule::SEVENTH_OUTPUT));
  60. addChild(ModuleLightWidget::create<SmallLight<GreenLight>>(
  61. Vec(51.5, 293.06), module, M1x8CVModule::SEVENTH_LED));
  62. addInput(Port::create<RCJackSmallLight>(Vec(0.48, 305), Port::INPUT, module,
  63. M1x8CVModule::EIGHTH_CV));
  64. addOutput(Port::create<RCJackSmallDark>(Vec(25.23, 305), Port::OUTPUT, module,
  65. M1x8CVModule::EIGHTH_OUTPUT));
  66. addChild(ModuleLightWidget::create<SmallLight<GreenLight>>(
  67. Vec(51.5, 314.06), module, M1x8CVModule::EIGHTH_LED));
  68. }
  69. } // namespace rack_plugin_SynthKit
  70. using namespace rack_plugin_SynthKit;
  71. RACK_PLUGIN_MODEL_INIT(SynthKit, M1x8CV) {
  72. Model *modelM1x8CV = Model::create<M1x8CVModule, M1x8CVWidget>(
  73. "SynthKit", "1x8 Splitter (CV)", "1x8 Splitter (CV)", MIXER_TAG);
  74. return modelM1x8CV;
  75. }