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.

84 lines
2.3KB

  1. #pragma once
  2. #include <vector>
  3. #include <jansson.h>
  4. #include <common.hpp>
  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. /** A one-line summary of the plugin's purpose.
  34. If your plugin doesn't follow a theme, it’s probably best to omit this.
  35. */
  36. std::string description;
  37. /** Your name, company, alias, or GitHub username.
  38. */
  39. std::string author;
  40. /** Your email address for support inquiries.
  41. */
  42. std::string authorEmail;
  43. /** Homepage of the author.
  44. */
  45. std::string authorUrl;
  46. /** Homepage featuring the plugin itself.
  47. */
  48. std::string pluginUrl;
  49. /** The manual of your plugin. HTML, PDF, or GitHub readme/wiki are fine.
  50. */
  51. std::string manualUrl;
  52. /** The source code homepage. E.g. GitHub repo.
  53. */
  54. std::string sourceUrl;
  55. /** Link to donation page for users who wish to donate. E.g. PayPal URL.
  56. */
  57. std::string donateUrl;
  58. /** Link to the changelog of the plugin.
  59. */
  60. std::string changelogUrl;
  61. /** Last modified timestamp of the plugin directory.
  62. */
  63. double modifiedTimestamp = -INFINITY;
  64. ~Plugin();
  65. void addModel(Model* model);
  66. Model* getModel(const std::string& slug);
  67. void fromJson(json_t* rootJ);
  68. std::string getBrand();
  69. };
  70. } // namespace plugin
  71. } // namespace rack