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.

157 lines
3.4KB

  1. #pragma once
  2. #include "scene.hpp"
  3. namespace rack {
  4. ////////////////////
  5. // Knobs
  6. ////////////////////
  7. struct KnobDavies1900h : SpriteKnob {
  8. KnobDavies1900h() {
  9. box.size = Vec(36, 36);
  10. spriteOffset = Vec(-2, -2);
  11. spriteSize = Vec(42, 42);
  12. minIndex = 44;
  13. maxIndex = -46;
  14. spriteCount = 120;
  15. }
  16. };
  17. struct KnobDavies1900hWhite : KnobDavies1900h {
  18. KnobDavies1900hWhite() {
  19. spriteImage = Image::load("res/ComponentLibrary/Davies1900hWhite.png");
  20. }
  21. };
  22. struct KnobDavies1900hBlack : KnobDavies1900h {
  23. KnobDavies1900hBlack() {
  24. spriteImage = Image::load("res/ComponentLibrary/Davies1900hBlack.png");
  25. }
  26. };
  27. struct KnobDavies1900hRed : KnobDavies1900h {
  28. KnobDavies1900hRed() {
  29. spriteImage = Image::load("res/ComponentLibrary/Davies1900hRed.png");
  30. }
  31. };
  32. struct BefacoBigKnob : SpriteKnob {
  33. BefacoBigKnob() {
  34. box.size = Vec(75, 75);
  35. spriteOffset = Vec(-2, -2);
  36. spriteSize = Vec(81, 81);
  37. minIndex = 44;
  38. maxIndex = -46;
  39. spriteCount = 120;
  40. spriteImage = Image::load("res/ComponentLibrary/BefacoBigKnob.png");
  41. }
  42. };
  43. struct BefacoTinyKnob : SpriteKnob {
  44. BefacoTinyKnob() {
  45. box.size = Vec(26, 26);
  46. spriteOffset = Vec(-2, -2);
  47. spriteSize = Vec(32, 32);
  48. minIndex = 44;
  49. maxIndex = -46;
  50. spriteCount = 120;
  51. spriteImage = Image::load("res/ComponentLibrary/BefacoTinyKnob.png");
  52. }
  53. };
  54. struct BefacoSlidePot : SpriteKnob {
  55. BefacoSlidePot() {
  56. box.size = Vec(12, 122);
  57. spriteOffset = Vec(-2, -6);
  58. spriteSize = Vec(18, 134);
  59. minIndex = 97;
  60. maxIndex = 0;
  61. spriteCount = 98;
  62. spriteImage = Image::load("res/ComponentLibrary/BefacoSlidePot.png");
  63. }
  64. };
  65. ////////////////////
  66. // Jacks
  67. ////////////////////
  68. template <typename BASE>
  69. struct PJ301M : BASE {
  70. PJ301M() {
  71. this->box.size = Vec(24, 24);
  72. this->spriteOffset = Vec(-2, -2);
  73. this->spriteSize = Vec(30, 30);
  74. this->spriteImage = Image::load("res/ComponentLibrary/PJ301M.png");
  75. }
  76. };
  77. typedef PJ301M<InputPort> InputPortPJ301M;
  78. typedef PJ301M<OutputPort> OutputPortPJ301M;
  79. template <typename BASE>
  80. struct PJ3410 : BASE {
  81. PJ3410() {
  82. this->box.size = Vec(32, 32);
  83. this->spriteOffset = Vec(-1, -1);
  84. this->spriteSize = Vec(36, 36);
  85. this->spriteImage = Image::load("res/ComponentLibrary/PJ3410.png");
  86. }
  87. };
  88. typedef PJ3410<InputPort> InputPortPJ3410;
  89. typedef PJ3410<OutputPort> OutputPortPJ3410;
  90. template <typename BASE>
  91. struct CL1362 : BASE {
  92. CL1362() {
  93. this->box.size = Vec(33, 29);
  94. this->spriteOffset = Vec(-2, -2);
  95. this->spriteSize = Vec(39, 36);
  96. this->spriteImage = Image::load("res/ComponentLibrary/CL1362.png");
  97. }
  98. };
  99. typedef CL1362<InputPort> InputPortCL1362;
  100. typedef CL1362<OutputPort> OutputPortCL1362;
  101. ////////////////////
  102. // Misc
  103. ////////////////////
  104. /** If you don't add these to your ModuleWidget, it will fall out of the rack... */
  105. struct Screw : SpriteWidget {
  106. Screw() {
  107. box.size = Vec(15, 14);
  108. spriteOffset = Vec(0, 0);
  109. spriteSize = Vec(15, 14);
  110. }
  111. };
  112. struct BlackScrew : Screw {
  113. BlackScrew() {
  114. spriteImage = Image::load("res/ComponentLibrary/ScrewBlack.png");
  115. }
  116. };
  117. struct SilverScrew : Screw {
  118. SilverScrew() {
  119. spriteImage = Image::load("res/ComponentLibrary/ScrewSilver.png");
  120. }
  121. };
  122. struct LightPanel : Panel {
  123. LightPanel() {
  124. backgroundColor = nvgRGB(0xe8, 0xe8, 0xe8);
  125. borderColor = nvgRGB(0xac, 0xac, 0xac);
  126. }
  127. };
  128. struct DarkPanel : Panel {
  129. DarkPanel() {
  130. backgroundColor = nvgRGB(0x0f, 0x0f, 0x0f);
  131. borderColor = nvgRGB(0x5e, 0x5e, 0x5e);
  132. }
  133. };
  134. } // namespace rack