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.

139 lines
4.1KB

  1. /*
  2. * DISTRHO CVCRack Plugin
  3. * Copyright (C) 2021 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any purpose with
  6. * or without fee is hereby granted, provided that the above copyright notice and this
  7. * permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
  10. * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
  11. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  12. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  13. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #include "DistrhoPlugin.hpp"
  17. START_NAMESPACE_DISTRHO
  18. // -----------------------------------------------------------------------------------------------------------
  19. /**
  20. Plugin to demonstrate parameter outputs using meters.
  21. */
  22. class CVCRackPlugin : public Plugin
  23. {
  24. public:
  25. CVCRackPlugin()
  26. : Plugin(0, 0, 0)
  27. {
  28. }
  29. protected:
  30. /* --------------------------------------------------------------------------------------------------------
  31. * Information */
  32. /**
  33. Get the plugin label.
  34. A plugin label follows the same rules as Parameter::symbol, with the exception that it can start with numbers.
  35. */
  36. const char* getLabel() const override
  37. {
  38. return "CVCRack";
  39. }
  40. /**
  41. Get an extensive comment/description about the plugin.
  42. */
  43. const char* getDescription() const override
  44. {
  45. return "...";
  46. }
  47. /**
  48. Get the plugin author/maker.
  49. */
  50. const char* getMaker() const override
  51. {
  52. return "DISTRHO";
  53. }
  54. /**
  55. Get the plugin homepage.
  56. */
  57. const char* getHomePage() const override
  58. {
  59. return "https://github.com/DISTRHO/CVCRack";
  60. }
  61. /**
  62. Get the plugin license name (a single line of text).
  63. For commercial plugins this should return some short copyright information.
  64. */
  65. const char* getLicense() const override
  66. {
  67. return "ISC";
  68. }
  69. /**
  70. Get the plugin version, in hexadecimal.
  71. */
  72. uint32_t getVersion() const override
  73. {
  74. return d_version(1, 0, 0);
  75. }
  76. /**
  77. Get the plugin unique Id.
  78. This value is used by LADSPA, DSSI and VST plugin formats.
  79. */
  80. int64_t getUniqueId() const override
  81. {
  82. return d_cconst('d', 'C', 'V', 'C');
  83. }
  84. /* --------------------------------------------------------------------------------------------------------
  85. * Init */
  86. /* --------------------------------------------------------------------------------------------------------
  87. * Internal data */
  88. /* --------------------------------------------------------------------------------------------------------
  89. * Process */
  90. /**
  91. Run/process function for plugins without MIDI input.
  92. */
  93. void run(const float** inputs, float** outputs, uint32_t frames) override
  94. {
  95. // copy inputs over outputs if needed
  96. if (outputs[0] != inputs[0])
  97. std::memcpy(outputs[0], inputs[0], sizeof(float)*frames);
  98. if (outputs[1] != inputs[1])
  99. std::memcpy(outputs[1], inputs[1], sizeof(float)*frames);
  100. }
  101. // -------------------------------------------------------------------------------------------------------
  102. private:
  103. /**
  104. Set our plugin class as non-copyable and add a leak detector just in case.
  105. */
  106. DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CVCRackPlugin)
  107. };
  108. /* ------------------------------------------------------------------------------------------------------------
  109. * Plugin entry point, called by DPF to create a new plugin instance. */
  110. Plugin* createPlugin()
  111. {
  112. return new CVCRackPlugin();
  113. }
  114. // -----------------------------------------------------------------------------------------------------------
  115. END_NAMESPACE_DISTRHO