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.

176 lines
5.4KB

  1. #include "rack.hpp"
  2. using namespace rack;
  3. RACK_PLUGIN_DECLARE(Ohmer);
  4. #ifdef USE_VST2
  5. #define plugin "Ohmer"
  6. #endif // USE_VST2
  7. namespace rack_plugin_Ohmer {
  8. //// COLOR TABLE USED FOR DOT-MATRIX DISPLAY (REGARDLING SELECTED MODEL).
  9. static const NVGcolor tblDMDtextColor[6] = {
  10. nvgRGB(0x08, 0x08, 0x08), // LCD-like for Classic.
  11. nvgRGB(0x08, 0x08, 0x08), // LCD-like for Stage Repro.
  12. nvgRGB(0x08, 0x08, 0x08), // LCD-like for Absolute Night.
  13. nvgRGB(0xe0, 0xe0, 0xff), // Blue plasma-like for Dark "Signature".
  14. nvgRGB(0xff, 0x8a, 0x00), // Orange plasma-like for Deepblue "Signature".
  15. nvgRGB(0xb0, 0xff, 0xff) // Light cyan plasma-like for Carbon "Signature".
  16. };
  17. //// CUSTOM COMPONENTS (SCREWS, JACKS, KNOBS, ENCODERS, BUTTONS, LEDS).
  18. // Custom silver Torx screw.
  19. struct Torx_Silver : SVGScrew {
  20. Torx_Silver() {
  21. sw->svg = SVG::load(assetPlugin(plugin, "res/components/Torx_Silver.svg"));
  22. sw->wrap();
  23. box.size = sw->box.size;
  24. }
  25. };
  26. // Custom gols Torx screw.
  27. struct Torx_Gold : SVGScrew {
  28. Torx_Gold() {
  29. sw->svg = SVG::load(assetPlugin(plugin, "res/components/Torx_Gold.svg"));
  30. sw->wrap();
  31. box.size = sw->box.size;
  32. }
  33. };
  34. // Silver momentary button (used by standard-line KlokSpid modules).
  35. // This button is used for:
  36. // - BPM start/stop toggle (KlokSpid module acting as standalone BPM clock generator).
  37. // - entering Setup (by holding this button).
  38. // - advance to next Setup parameter (and exit Setup).
  39. struct KS_ButtonSilver : SVGSwitch, MomentarySwitch {
  40. KS_ButtonSilver() {
  41. addFrame(SVG::load(assetPlugin(plugin,"res/components/KS_Button_Up_Silver.svg")));
  42. addFrame(SVG::load(assetPlugin(plugin,"res/components/KS_Button_Down_Silver.svg")));
  43. }
  44. };
  45. // Gold momentary button (used by Signature-line KlokSpid modules).
  46. struct KS_ButtonGold : SVGSwitch, MomentarySwitch {
  47. KS_ButtonGold() {
  48. addFrame(SVG::load(assetPlugin(plugin,"res/components/KS_Button_Up_Gold.svg")));
  49. addFrame(SVG::load(assetPlugin(plugin,"res/components/KS_Button_Down_Gold.svg")));
  50. }
  51. };
  52. // RKD jumper shunts (working as ON/OFF toggle switch).
  53. struct RKD_Jumper : SVGSwitch, ToggleSwitch {
  54. RKD_Jumper() {
  55. addFrame(SVG::load(assetPlugin(plugin,"res/components/PCB_BJ_Off.svg")));
  56. addFrame(SVG::load(assetPlugin(plugin,"res/components/PCB_BJ_On.svg")));
  57. }
  58. };
  59. // RKDBRK toggle switch (working as ON/OFF).
  60. struct RKDBRK_Switch : SVGSwitch, ToggleSwitch {
  61. RKDBRK_Switch() {
  62. addFrame(SVG::load(assetPlugin(plugin,"res/components/NKKH_0.svg")));
  63. addFrame(SVG::load(assetPlugin(plugin,"res/components/NKKH_1.svg")));
  64. }
  65. };
  66. // Custom port, with red in-ring (input port), gold.
  67. struct PJ301M_In : SVGPort {
  68. PJ301M_In() {
  69. background->svg = SVG::load(assetPlugin(plugin,"res/components/PJ301M_In.svg"));
  70. background->wrap();
  71. box.size = background->box.size;
  72. }
  73. };
  74. // Custom port, with green in-ring (output port), gold.
  75. struct PJ301M_Out : SVGPort {
  76. PJ301M_Out() {
  77. background->svg = SVG::load(assetPlugin(plugin,"res/components/PJ301M_Out.svg"));
  78. background->wrap();
  79. box.size = background->box.size;
  80. }
  81. };
  82. // Custom nickel metal port, with red in-ring (input port), used only by RKD & RKD-BRK modules (CLK jack). Derived from default CL1362.svg
  83. struct CL1362_In : SVGPort {
  84. CL1362_In() {
  85. background->svg = SVG::load(assetPlugin(plugin,"res/components/CL1362_In.svg"));
  86. background->wrap();
  87. box.size = background->box.size;
  88. }
  89. };
  90. // Custom nickel metal port, with red in-ring (input port), used only by RKD & RKD-BRK modules (90° rotated for... ROTATE and RESET input ports). Derived from default CL1362.svg
  91. struct CL1362_In_RR : SVGPort {
  92. CL1362_In_RR() {
  93. background->svg = SVG::load(assetPlugin(plugin,"res/components/CL1362_In_RR.svg"));
  94. background->wrap();
  95. box.size = background->box.size;
  96. }
  97. };
  98. // Custom nickel metal port, with green in-ring (output port), used only by RKD & RKD-BRK modules. Derived from default CL1362.svg
  99. struct CL1362_Out : SVGPort {
  100. CL1362_Out() {
  101. background->svg = SVG::load(assetPlugin(plugin,"res/components/CL1362_Out.svg"));
  102. background->wrap();
  103. box.size = background->box.size;
  104. }
  105. };
  106. // Freeware "Moog-style" continuous encoder, used by KlokSpid and Metriks modules.
  107. struct KS_Encoder : SVGKnob {
  108. KS_Encoder() {
  109. minAngle = -1.0 * M_PI;
  110. maxAngle = M_PI;
  111. setSVG(SVG::load(assetPlugin(plugin, "res/components/KS_Encoder.svg")));
  112. //smooth = false;
  113. }
  114. };
  115. // Custom orange color used by two small LEDs (CV-RATIO, start/stop), KlokSpid module.
  116. // Also, this color is used for medium LED located below CV/TRIG port (KlokSpid module).
  117. struct KlokSpidOrangeLight : GrayModuleLightWidget {
  118. KlokSpidOrangeLight() {
  119. addBaseColor(nvgRGB(0xe8, 0xad, 0x10));
  120. }
  121. };
  122. // White LED color for RKD & RKD-BRK modules (used for CLK and output 8).
  123. struct RKDWhiteLight : GrayModuleLightWidget {
  124. RKDWhiteLight() {
  125. addBaseColor(nvgRGB(0xff, 0xff, 0xff));
  126. }
  127. };
  128. // White LED color for RKD & RKD-BRK modules(used for output 2).
  129. struct RKDOrangeLight : GrayModuleLightWidget {
  130. RKDOrangeLight() {
  131. addBaseColor(nvgRGB(0xf2, 0xb1, 0x20));
  132. }
  133. };
  134. // White LED color for RKD & RKD-BRK modules (used for output 7).
  135. struct RKDPurpleLight : GrayModuleLightWidget {
  136. RKDPurpleLight() {
  137. addBaseColor(nvgRGB(0xd5, 0x2b, 0xed));
  138. }
  139. };
  140. // Tri-colored red/orange/blue LED for RKD & RKD-BRK modules (used by "RESET").
  141. struct RedOrangeBlueLight : GrayModuleLightWidget {
  142. RedOrangeBlueLight() {
  143. addBaseColor(COLOR_RED);
  144. addBaseColor(nvgRGB(0xe8, 0xad, 0x10)); // Orange (same used by KlokSpid module).
  145. addBaseColor(COLOR_BLUE);
  146. }
  147. };
  148. } // namespace rack_plugin_Ohmer
  149. using namespace rack_plugin_Ohmer;