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.

componentlibrary.hpp 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625
  1. #pragma once
  2. #include "app/SvgKnob.hpp"
  3. #include "app/SvgSlider.hpp"
  4. #include "app/SvgPort.hpp"
  5. #include "app/ModuleLightWidget.hpp"
  6. #include "app/SvgSwitch.hpp"
  7. #include "app/SvgScrew.hpp"
  8. #include "asset.hpp"
  9. namespace rack {
  10. /** Component Library by [Grayscale](https://grayscale.info/).
  11. Copied from `LICENSE.md`:
  12. The **Component Library graphics** in the `res/ComponentLibrary` directory are copyright © 2019 [Grayscale](http://grayscale.info/) and licensed under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/).
  13. You may not freely sell plugins using Component Library graphics.
  14. However, a free commercial license is available for plugins sold through the [VCV Store](https://vcvrack.com/plugins.html).
  15. Email contact@vcvrack.com for more information about licensing or the VCV Store.
  16. */
  17. namespace componentlibrary {
  18. ////////////////////
  19. // Color scheme
  20. ////////////////////
  21. static const NVGcolor SCHEME_BLACK_TRANSPARENT = nvgRGBA(0x00, 0x00, 0x00, 0x00);
  22. static const NVGcolor SCHEME_BLACK = nvgRGB(0x00, 0x00, 0x00);
  23. static const NVGcolor SCHEME_WHITE = nvgRGB(0xff, 0xff, 0xff);
  24. static const NVGcolor SCHEME_RED = nvgRGB(0xed, 0x2c, 0x24);
  25. static const NVGcolor SCHEME_ORANGE = nvgRGB(0xf2, 0xb1, 0x20);
  26. static const NVGcolor SCHEME_YELLOW = nvgRGB(0xf9, 0xdf, 0x1c);
  27. static const NVGcolor SCHEME_GREEN = nvgRGB(0x90, 0xc7, 0x3e);
  28. static const NVGcolor SCHEME_CYAN = nvgRGB(0x22, 0xe6, 0xef);
  29. static const NVGcolor SCHEME_BLUE = nvgRGB(0x29, 0xb2, 0xef);
  30. static const NVGcolor SCHEME_PURPLE = nvgRGB(0xd5, 0x2b, 0xed);
  31. static const NVGcolor SCHEME_LIGHT_GRAY = nvgRGB(0xe6, 0xe6, 0xe6);
  32. static const NVGcolor SCHEME_DARK_GRAY = nvgRGB(0x17, 0x17, 0x17);
  33. ////////////////////
  34. // Knobs
  35. ////////////////////
  36. struct RoundKnob : app::SvgKnob {
  37. RoundKnob() {
  38. minAngle = -0.83*M_PI;
  39. maxAngle = 0.83*M_PI;
  40. }
  41. };
  42. struct RoundBlackKnob : RoundKnob {
  43. RoundBlackKnob() {
  44. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/RoundBlackKnob.svg")));
  45. }
  46. };
  47. struct RoundSmallBlackKnob : RoundKnob {
  48. RoundSmallBlackKnob() {
  49. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/RoundSmallBlackKnob.svg")));
  50. }
  51. };
  52. struct RoundLargeBlackKnob : RoundKnob {
  53. RoundLargeBlackKnob() {
  54. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/RoundLargeBlackKnob.svg")));
  55. }
  56. };
  57. struct RoundHugeBlackKnob : RoundKnob {
  58. RoundHugeBlackKnob() {
  59. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/RoundHugeBlackKnob.svg")));
  60. }
  61. };
  62. struct RoundBlackSnapKnob : RoundBlackKnob {
  63. RoundBlackSnapKnob() {
  64. snap = true;
  65. }
  66. };
  67. struct Davies1900hKnob : app::SvgKnob {
  68. Davies1900hKnob() {
  69. minAngle = -0.83*M_PI;
  70. maxAngle = 0.83*M_PI;
  71. }
  72. };
  73. struct Davies1900hWhiteKnob : Davies1900hKnob {
  74. Davies1900hWhiteKnob() {
  75. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Davies1900hWhite.svg")));
  76. }
  77. };
  78. struct Davies1900hBlackKnob : Davies1900hKnob {
  79. Davies1900hBlackKnob() {
  80. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Davies1900hBlack.svg")));
  81. }
  82. };
  83. struct Davies1900hRedKnob : Davies1900hKnob {
  84. Davies1900hRedKnob() {
  85. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Davies1900hRed.svg")));
  86. }
  87. };
  88. struct Davies1900hLargeWhiteKnob : Davies1900hKnob {
  89. Davies1900hLargeWhiteKnob() {
  90. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Davies1900hLargeWhite.svg")));
  91. }
  92. };
  93. struct Davies1900hLargeBlackKnob : Davies1900hKnob {
  94. Davies1900hLargeBlackKnob() {
  95. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Davies1900hLargeBlack.svg")));
  96. }
  97. };
  98. struct Davies1900hLargeRedKnob : Davies1900hKnob {
  99. Davies1900hLargeRedKnob() {
  100. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Davies1900hLargeRed.svg")));
  101. }
  102. };
  103. struct Rogan : app::SvgKnob {
  104. Rogan() {
  105. minAngle = -0.83*M_PI;
  106. maxAngle = 0.83*M_PI;
  107. }
  108. };
  109. struct Rogan6PSWhite : Rogan {
  110. Rogan6PSWhite() {
  111. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan6PSWhite.svg")));
  112. }
  113. };
  114. struct Rogan5PSGray : Rogan {
  115. Rogan5PSGray() {
  116. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan5PSGray.svg")));
  117. }
  118. };
  119. struct Rogan3PSBlue : Rogan {
  120. Rogan3PSBlue() {
  121. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan3PSBlue.svg")));
  122. }
  123. };
  124. struct Rogan3PSRed : Rogan {
  125. Rogan3PSRed() {
  126. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan3PSRed.svg")));
  127. }
  128. };
  129. struct Rogan3PSGreen : Rogan {
  130. Rogan3PSGreen() {
  131. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan3PSGreen.svg")));
  132. }
  133. };
  134. struct Rogan3PSWhite : Rogan {
  135. Rogan3PSWhite() {
  136. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan3PSWhite.svg")));
  137. }
  138. };
  139. struct Rogan3PBlue : Rogan {
  140. Rogan3PBlue() {
  141. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan3PBlue.svg")));
  142. }
  143. };
  144. struct Rogan3PRed : Rogan {
  145. Rogan3PRed() {
  146. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan3PRed.svg")));
  147. }
  148. };
  149. struct Rogan3PGreen : Rogan {
  150. Rogan3PGreen() {
  151. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan3PGreen.svg")));
  152. }
  153. };
  154. struct Rogan3PWhite : Rogan {
  155. Rogan3PWhite() {
  156. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan3PWhite.svg")));
  157. }
  158. };
  159. struct Rogan2SGray : Rogan {
  160. Rogan2SGray() {
  161. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan2SGray.svg")));
  162. }
  163. };
  164. struct Rogan2PSBlue : Rogan {
  165. Rogan2PSBlue() {
  166. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan2PSBlue.svg")));
  167. }
  168. };
  169. struct Rogan2PSRed : Rogan {
  170. Rogan2PSRed() {
  171. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan2PSRed.svg")));
  172. }
  173. };
  174. struct Rogan2PSGreen : Rogan {
  175. Rogan2PSGreen() {
  176. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan2PSGreen.svg")));
  177. }
  178. };
  179. struct Rogan2PSWhite : Rogan {
  180. Rogan2PSWhite() {
  181. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan2PSWhite.svg")));
  182. }
  183. };
  184. struct Rogan2PBlue : Rogan {
  185. Rogan2PBlue() {
  186. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan2PBlue.svg")));
  187. }
  188. };
  189. struct Rogan2PRed : Rogan {
  190. Rogan2PRed() {
  191. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan2PRed.svg")));
  192. }
  193. };
  194. struct Rogan2PGreen : Rogan {
  195. Rogan2PGreen() {
  196. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan2PGreen.svg")));
  197. }
  198. };
  199. struct Rogan2PWhite : Rogan {
  200. Rogan2PWhite() {
  201. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan2PWhite.svg")));
  202. }
  203. };
  204. struct Rogan1PSBlue : Rogan {
  205. Rogan1PSBlue() {
  206. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan1PSBlue.svg")));
  207. }
  208. };
  209. struct Rogan1PSRed : Rogan {
  210. Rogan1PSRed() {
  211. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan1PSRed.svg")));
  212. }
  213. };
  214. struct Rogan1PSGreen : Rogan {
  215. Rogan1PSGreen() {
  216. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan1PSGreen.svg")));
  217. }
  218. };
  219. struct Rogan1PSWhite : Rogan {
  220. Rogan1PSWhite() {
  221. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan1PSWhite.svg")));
  222. }
  223. };
  224. struct Rogan1PBlue : Rogan {
  225. Rogan1PBlue() {
  226. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan1PBlue.svg")));
  227. }
  228. };
  229. struct Rogan1PRed : Rogan {
  230. Rogan1PRed() {
  231. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan1PRed.svg")));
  232. }
  233. };
  234. struct Rogan1PGreen : Rogan {
  235. Rogan1PGreen() {
  236. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan1PGreen.svg")));
  237. }
  238. };
  239. struct Rogan1PWhite : Rogan {
  240. Rogan1PWhite() {
  241. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Rogan1PWhite.svg")));
  242. }
  243. };
  244. struct SynthTechAlco : app::SvgKnob {
  245. SynthTechAlco() {
  246. minAngle = -0.82*M_PI;
  247. maxAngle = 0.82*M_PI;
  248. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/SynthTechAlco.svg")));
  249. widget::SvgWidget *cap = new widget::SvgWidget;
  250. cap->setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/SynthTechAlco_cap.svg")));
  251. addChild(cap);
  252. }
  253. };
  254. struct Trimpot : app::SvgKnob {
  255. Trimpot() {
  256. minAngle = -0.75*M_PI;
  257. maxAngle = 0.75*M_PI;
  258. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/Trimpot.svg")));
  259. }
  260. };
  261. struct BefacoBigKnob : app::SvgKnob {
  262. BefacoBigKnob() {
  263. minAngle = -0.75*M_PI;
  264. maxAngle = 0.75*M_PI;
  265. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/BefacoBigKnob.svg")));
  266. }
  267. };
  268. struct BefacoBigSnapKnob : BefacoBigKnob {
  269. BefacoBigSnapKnob() {
  270. snap = true;
  271. }
  272. };
  273. struct BefacoTinyKnob : app::SvgKnob {
  274. BefacoTinyKnob() {
  275. minAngle = -0.75*M_PI;
  276. maxAngle = 0.75*M_PI;
  277. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/BefacoTinyKnob.svg")));
  278. }
  279. };
  280. struct BefacoSlidePot : app::SvgSlider {
  281. BefacoSlidePot() {
  282. math::Vec margin = math::Vec(3.5, 3.5);
  283. maxHandlePos = math::Vec(-1, -2).plus(margin);
  284. minHandlePos = math::Vec(-1, 87).plus(margin);
  285. setBackgroundSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/BefacoSlidePot.svg")));
  286. setHandleSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/BefacoSlidePotHandle.svg")));
  287. background->box.pos = margin;
  288. box.size = background->box.size.plus(margin.mult(2));
  289. }
  290. };
  291. struct LEDSlider : app::SvgSlider {
  292. LEDSlider() {
  293. maxHandlePos = app::mm2px(math::Vec(0.738, 0.738).plus(math::Vec(2, 0)));
  294. minHandlePos = app::mm2px(math::Vec(0.738, 22.078).plus(math::Vec(2, 0)));
  295. setBackgroundSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/LEDSlider.svg")));
  296. }
  297. };
  298. /** API is unstable for LEDSlider. Will add a LightWidget later. */
  299. struct LEDSliderGreen : LEDSlider {
  300. LEDSliderGreen() {
  301. setHandleSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/LEDSliderGreenHandle.svg")));
  302. }
  303. };
  304. struct LEDSliderRed : LEDSlider {
  305. LEDSliderRed() {
  306. setHandleSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/LEDSliderRedHandle.svg")));
  307. }
  308. };
  309. struct LEDSliderYellow : LEDSlider {
  310. LEDSliderYellow() {
  311. setHandleSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/LEDSliderYellowHandle.svg")));
  312. }
  313. };
  314. struct LEDSliderBlue : LEDSlider {
  315. LEDSliderBlue() {
  316. setHandleSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/LEDSliderBlueHandle.svg")));
  317. }
  318. };
  319. struct LEDSliderWhite : LEDSlider {
  320. LEDSliderWhite() {
  321. setHandleSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/LEDSliderWhiteHandle.svg")));
  322. }
  323. };
  324. ////////////////////
  325. // Ports
  326. ////////////////////
  327. struct PJ301MPort : app::SvgPort {
  328. PJ301MPort() {
  329. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/PJ301M.svg")));
  330. }
  331. };
  332. struct PJ3410Port : app::SvgPort {
  333. PJ3410Port() {
  334. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/PJ3410.svg")));
  335. }
  336. };
  337. struct CL1362Port : app::SvgPort {
  338. CL1362Port() {
  339. setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/CL1362.svg")));
  340. }
  341. };
  342. ////////////////////
  343. // Lights
  344. ////////////////////
  345. struct GrayModuleLightWidget : app::ModuleLightWidget {
  346. GrayModuleLightWidget() {
  347. bgColor = nvgRGB(0x5a, 0x5a, 0x5a);
  348. borderColor = nvgRGBA(0, 0, 0, 0x60);
  349. }
  350. };
  351. struct RedLight : GrayModuleLightWidget {
  352. RedLight() {
  353. addBaseColor(SCHEME_RED);
  354. }
  355. };
  356. struct GreenLight : GrayModuleLightWidget {
  357. GreenLight() {
  358. addBaseColor(SCHEME_GREEN);
  359. }
  360. };
  361. struct YellowLight : GrayModuleLightWidget {
  362. YellowLight() {
  363. addBaseColor(SCHEME_YELLOW);
  364. }
  365. };
  366. struct BlueLight : GrayModuleLightWidget {
  367. BlueLight() {
  368. addBaseColor(SCHEME_BLUE);
  369. }
  370. };
  371. /** Reads two adjacent lightIds, so `lightId` and `lightId + 1` must be defined */
  372. struct GreenRedLight : GrayModuleLightWidget {
  373. GreenRedLight() {
  374. addBaseColor(SCHEME_GREEN);
  375. addBaseColor(SCHEME_RED);
  376. }
  377. };
  378. struct RedGreenBlueLight : GrayModuleLightWidget {
  379. RedGreenBlueLight() {
  380. addBaseColor(SCHEME_RED);
  381. addBaseColor(SCHEME_GREEN);
  382. addBaseColor(SCHEME_BLUE);
  383. }
  384. };
  385. struct RGBLight : app::ModuleLightWidget {
  386. RGBLight() {
  387. addBaseColor(nvgRGBf(1, 0, 0));
  388. addBaseColor(nvgRGBf(0, 1, 0));
  389. addBaseColor(nvgRGBf(0, 0, 1));
  390. }
  391. };
  392. /** Based on the size of 5mm LEDs */
  393. template <typename BASE>
  394. struct LargeLight : BASE {
  395. LargeLight() {
  396. this->box.size = app::mm2px(math::Vec(5.179, 5.179));
  397. }
  398. };
  399. /** Based on the size of 3mm LEDs */
  400. template <typename BASE>
  401. struct MediumLight : BASE {
  402. MediumLight() {
  403. this->box.size = app::mm2px(math::Vec(3.176, 3.176));
  404. }
  405. };
  406. /** Based on the size of 2mm LEDs */
  407. template <typename BASE>
  408. struct SmallLight : BASE {
  409. SmallLight() {
  410. this->box.size = app::mm2px(math::Vec(2.176, 2.176));
  411. }
  412. };
  413. /** Based on the size of 1mm LEDs */
  414. template <typename BASE>
  415. struct TinyLight : BASE {
  416. TinyLight() {
  417. this->box.size = app::mm2px(math::Vec(1.088, 1.088));
  418. }
  419. };
  420. /** A light to displayed over PB61303. Must add a color by subclassing or templating. */
  421. template <typename BASE>
  422. struct LEDBezelLight : BASE {
  423. LEDBezelLight() {
  424. this->bgColor = color::BLACK_TRANSPARENT;
  425. this->box.size = app::mm2px(math::Vec(6.0, 6.0));
  426. }
  427. };
  428. /** A light to displayed over PB61303. Must add a color by subclassing or templating.
  429. Don't add this as a child of the PB61303 itself. Instead, just place it over it as a sibling in the scene graph, offset by app::mm2px(math::Vec(0.5, 0.5)).
  430. */
  431. template <typename BASE>
  432. struct PB61303Light : BASE {
  433. PB61303Light() {
  434. this->bgColor = color::BLACK_TRANSPARENT;
  435. this->box.size = app::mm2px(math::Vec(9.0, 9.0));
  436. }
  437. };
  438. ////////////////////
  439. // Switches
  440. ////////////////////
  441. struct NKK : app::SvgSwitch {
  442. NKK() {
  443. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/NKK_0.svg")));
  444. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/NKK_1.svg")));
  445. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/NKK_2.svg")));
  446. }
  447. };
  448. struct CKSS : app::SvgSwitch {
  449. CKSS() {
  450. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/CKSS_0.svg")));
  451. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/CKSS_1.svg")));
  452. }
  453. };
  454. struct CKSSThree : app::SvgSwitch {
  455. CKSSThree() {
  456. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/CKSSThree_0.svg")));
  457. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/CKSSThree_1.svg")));
  458. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/CKSSThree_2.svg")));
  459. }
  460. };
  461. struct CKD6 : app::SvgSwitch {
  462. CKD6() {
  463. momentary = true;
  464. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/CKD6_0.svg")));
  465. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/CKD6_1.svg")));
  466. }
  467. };
  468. struct TL1105 : app::SvgSwitch {
  469. TL1105() {
  470. momentary = true;
  471. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/TL1105_0.svg")));
  472. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/TL1105_1.svg")));
  473. }
  474. };
  475. struct LEDButton : app::SvgSwitch {
  476. LEDButton() {
  477. momentary = true;
  478. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/LEDButton.svg")));
  479. }
  480. };
  481. struct BefacoSwitch : app::SvgSwitch {
  482. BefacoSwitch() {
  483. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/BefacoSwitch_0.svg")));
  484. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/BefacoSwitch_1.svg")));
  485. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/BefacoSwitch_2.svg")));
  486. }
  487. };
  488. struct BefacoPush : app::SvgSwitch {
  489. BefacoPush() {
  490. momentary = true;
  491. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/BefacoPush_0.svg")));
  492. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/BefacoPush_1.svg")));
  493. }
  494. };
  495. struct LEDBezel : app::SvgSwitch {
  496. LEDBezel() {
  497. momentary = true;
  498. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/LEDBezel.svg")));
  499. }
  500. };
  501. struct PB61303 : app::SvgSwitch {
  502. PB61303() {
  503. momentary = true;
  504. addFrame(APP->window->loadSvg(asset::system("res/ComponentLibrary/PB61303.svg")));
  505. }
  506. };
  507. ////////////////////
  508. // Misc
  509. ////////////////////
  510. struct ScrewSilver : app::SvgScrew {
  511. ScrewSilver() {
  512. sw->setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/ScrewSilver.svg")));
  513. box.size = sw->box.size;
  514. }
  515. };
  516. struct ScrewBlack : app::SvgScrew {
  517. ScrewBlack() {
  518. sw->setSvg(APP->window->loadSvg(asset::system("res/ComponentLibrary/ScrewBlack.svg")));
  519. box.size = sw->box.size;
  520. }
  521. };
  522. } // namespace componentlibrary
  523. } // namespace rack