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.

146 lines
4.9KB

  1. /*
  2. Copyright (c) 2017 Leonardo Laguna Ruiz (modlfo@gmail.com), All rights reserved.
  3. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  4. 1.- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  5. 2.- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  6. 3.- Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
  7. 4.- Commercial use requires explicit permission of the author.
  8. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  9. */
  10. #include "rack.hpp"
  11. using namespace rack;
  12. RACK_PLUGIN_DECLARE(VultModules);
  13. #ifdef USE_VST2
  14. #define plugin "VultModules"
  15. #endif // USE_VST2
  16. struct VultKnobBig : SVGKnob
  17. {
  18. VultKnobBig()
  19. {
  20. box.size = Vec(60, 60);
  21. minAngle = -0.75 * M_PI;
  22. maxAngle = 0.75 * M_PI;
  23. setSVG(SVG::load(assetPlugin(plugin, "res/KnobBig.svg")));
  24. }
  25. };
  26. struct VultKnob : SVGKnob
  27. {
  28. VultKnob()
  29. {
  30. box.size = Vec(40, 40);
  31. minAngle = -0.75 * M_PI;
  32. maxAngle = 0.75 * M_PI;
  33. setSVG(SVG::load(assetPlugin(plugin, "res/Knob.svg")));
  34. }
  35. };
  36. struct VultKnobAlt : SVGKnob
  37. {
  38. VultKnobAlt()
  39. {
  40. box.size = Vec(30, 30);
  41. minAngle = -0.75 * M_PI;
  42. maxAngle = 0.75 * M_PI;
  43. setSVG(SVG::load(assetPlugin(plugin, "res/KnobAlt.svg")));
  44. }
  45. };
  46. struct VultKnobSmall : SVGKnob
  47. {
  48. VultKnobSmall()
  49. {
  50. box.size = Vec(18, 18);
  51. minAngle = -0.75 * M_PI;
  52. maxAngle = 0.75 * M_PI;
  53. setSVG(SVG::load(assetPlugin(plugin, "res/KnobSmall.svg")));
  54. }
  55. };
  56. struct VultScrew : SVGScrew
  57. {
  58. VultScrew()
  59. {
  60. sw->svg = SVG::load(assetPlugin(plugin, "res/Screw.svg"));
  61. sw->wrap();
  62. box.size = sw->box.size;
  63. }
  64. };
  65. struct VultJack : SVGPort
  66. {
  67. VultJack()
  68. {
  69. background->svg = SVG::load(assetPlugin(plugin, "res/Jack.svg"));
  70. background->wrap();
  71. box.size = background->box.size;
  72. }
  73. };
  74. struct VultSelector3 : SVGSwitch, ToggleSwitch
  75. {
  76. VultSelector3()
  77. {
  78. addFrame(SVG::load(assetPlugin(plugin, "res/Select3_A.svg")));
  79. addFrame(SVG::load(assetPlugin(plugin, "res/Select3_B.svg")));
  80. addFrame(SVG::load(assetPlugin(plugin, "res/Select3_C.svg")));
  81. sw->wrap();
  82. box.size = sw->box.size;
  83. }
  84. };
  85. struct VultSelector2 : SVGSwitch, ToggleSwitch
  86. {
  87. VultSelector2()
  88. {
  89. addFrame(SVG::load(assetPlugin(plugin, "res/Select2_A.svg")));
  90. addFrame(SVG::load(assetPlugin(plugin, "res/Select2_B.svg")));
  91. sw->wrap();
  92. box.size = sw->box.size;
  93. }
  94. };
  95. struct TrummodOscSelector : SVGSwitch, ToggleSwitch
  96. {
  97. TrummodOscSelector()
  98. {
  99. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Tune.svg")));
  100. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Bend.svg")));
  101. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Drive.svg")));
  102. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Attack.svg")));
  103. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Hold.svg")));
  104. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Release.svg")));
  105. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Speed.svg")));
  106. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Source.svg")));
  107. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Level.svg")));
  108. sw->wrap();
  109. box.size = sw->box.size;
  110. }
  111. };
  112. struct TrummodNoiseSelector : SVGSwitch, ToggleSwitch
  113. {
  114. TrummodNoiseSelector()
  115. {
  116. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Tone.svg")));
  117. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Decimate.svg")));
  118. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Attack.svg")));
  119. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Hold.svg")));
  120. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Release.svg")));
  121. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Speed.svg")));
  122. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Source.svg")));
  123. addFrame(SVG::load(assetPlugin(plugin, "res/LCD-Level.svg")));
  124. sw->wrap();
  125. box.size = sw->box.size;
  126. }
  127. };