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.

96 lines
2.2KB

  1. /******************************************************************************
  2. * Copyright 2017-2018 Valerio Orlandini / Sonus Dept. <sonusdept@gmail.com>
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. *****************************************************************************/
  17. #include "rack.hpp"
  18. #include <climits>
  19. #include <cstdlib>
  20. #include <ctime>
  21. #include <cmath>
  22. #include <deque>
  23. #include <vector>
  24. using namespace rack;
  25. namespace rack_plugin_SonusModular {
  26. }
  27. RACK_PLUGIN_DECLARE(SonusModular);
  28. #ifdef USE_VST2
  29. #define plugin "SonusModular"
  30. #endif // USE_VST2
  31. struct SonusKnob : SVGKnob
  32. {
  33. SonusKnob()
  34. {
  35. box.size = Vec(36, 36);
  36. minAngle = -0.75 * M_PI;
  37. maxAngle = 0.75 * M_PI;
  38. setSVG(SVG::load(assetPlugin(plugin, "res/knob.svg")));
  39. }
  40. };
  41. struct SonusSnapKnob : SonusKnob
  42. {
  43. SonusSnapKnob()
  44. {
  45. snap = true;
  46. }
  47. };
  48. struct SonusBigKnob : SVGKnob
  49. {
  50. SonusBigKnob()
  51. {
  52. box.size = Vec(54, 54);
  53. minAngle = -0.75 * M_PI;
  54. maxAngle = 0.75 * M_PI;
  55. setSVG(SVG::load(assetPlugin(plugin, "res/bigknob.svg")));
  56. }
  57. };
  58. struct SonusBigSnapKnob : SonusBigKnob
  59. {
  60. SonusBigSnapKnob()
  61. {
  62. snap = true;
  63. }
  64. };
  65. struct SonusScrew : SVGKnob
  66. {
  67. SonusScrew()
  68. {
  69. minAngle = -0.99 * M_PI;
  70. maxAngle = 0.99 * M_PI;
  71. box.size = Vec(15, 15);
  72. setSVG(SVG::load(assetPlugin(plugin, "res/screw.svg")));
  73. }
  74. };
  75. struct SonusLedButton : SVGSwitch, ToggleSwitch
  76. {
  77. SonusLedButton()
  78. {
  79. addFrame(SVG::load(assetPlugin(plugin, "res/ledbutton_off.svg")));
  80. addFrame(SVG::load(assetPlugin(plugin, "res/ledbutton_on.svg")));
  81. }
  82. };