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.

74 lines
2.1KB

  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 to 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 after releasing your plugin.
  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. /** 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.
  24. */
  25. std::string license;
  26. /** Human-readable display name for your plugin. You can change this on a whim, unlike slugs.
  27. */
  28. std::string name;
  29. /** Prefix of each module name in the Module Browser.
  30. If blank, `name` is used.
  31. */
  32. std::string brand;
  33. /** Your name, company, alias, or GitHub username.
  34. */
  35. std::string author;
  36. /** Your email address for support inquiries.
  37. */
  38. std::string authorEmail;
  39. /** Homepage of the author.
  40. */
  41. std::string authorUrl;
  42. /** Homepage featuring the plugin itself.
  43. */
  44. std::string pluginUrl;
  45. /** The manual of your plugin. HTML, PDF, or GitHub readme/wiki are fine.
  46. */
  47. std::string manualUrl;
  48. /** The source code homepage. E.g. GitHub repo.
  49. */
  50. std::string sourceUrl;
  51. /** Link to donation page for users who wish to donate. E.g. PayPal URL.
  52. */
  53. std::string donateUrl;
  54. /** Last modified timestamp of the plugin directory.
  55. */
  56. double modifiedTimestamp = -INFINITY;
  57. ~Plugin();
  58. void addModel(Model* model);
  59. Model* getModel(std::string slug);
  60. void fromJson(json_t* rootJ);
  61. };
  62. } // namespace plugin
  63. } // namespace rack