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.

67 lines
1.9KB

  1. #pragma once
  2. #include "common.hpp"
  3. #include <jansson.h>
  4. #include <vector>
  5. namespace rack {
  6. namespace plugin {
  7. struct Model;
  8. // Subclass this and return a pointer to a new one when init() is called
  9. struct Plugin {
  10. /** A list of the models available by this plugin, add with addModel() */
  11. std::vector<Model*> models;
  12. /** The file path of the plugin's directory */
  13. std::string path;
  14. /** OS-dependent library handle */
  15. void *handle = NULL;
  16. /** Must be unique. Used for saving patches. Never change this.
  17. To guarantee uniqueness, it is a good idea to prefix the slug by your "company name" if available, e.g. "MyCompany-MyPlugin"
  18. */
  19. std::string slug;
  20. /** Your plugin's latest version, using the guidelines at https://github.com/VCVRack/Rack/issues/266. Do not include the "v" prefix.
  21. */
  22. std::string version;
  23. /** Human-readable display name for your plugin. You can change this on a whim, unlike slugs.
  24. */
  25. std::string name;
  26. /** The license type of your plugin. Use "proprietary" if all rights are reserved. If your license is in the [SPDX license list](https://spdx.org/licenses/), use its abbreviation in the "Identifier" column.
  27. */
  28. std::string license;
  29. /** Your name, company, alias, or GitHub username.
  30. */
  31. std::string author;
  32. /** Your email address for support inquiries.
  33. */
  34. std::string authorEmail;
  35. /** Homepage featuring the plugin itself.
  36. */
  37. std::string pluginUrl;
  38. /** Homepage of the author.
  39. */
  40. std::string authorUrl;
  41. /** The manual of your plugin. HTML, PDF, or GitHub readme/wiki are fine.
  42. */
  43. std::string manualUrl;
  44. /** The source code homepage. E.g. GitHub repo.
  45. */
  46. std::string sourceUrl;
  47. /** Link to donation page for users who wish to donate. E.g. PayPal URL.
  48. */
  49. std::string donateUrl;
  50. ~Plugin();
  51. void addModel(Model *model);
  52. Model *getModel(std::string slug);
  53. void fromJson(json_t *rootJ);
  54. };
  55. } // namespace plugin
  56. } // namespace rack