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.

52 lines
1.3KB

  1. #pragma once
  2. #include "common.hpp"
  3. #include <jansson.h>
  4. #include <list>
  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::list<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 patch files and the VCV store API.
  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. /** The version of your plugin
  21. Plugins should follow the versioning scheme described at https://github.com/VCVRack/Rack/issues/266
  22. Do not include the "v" in "v1.0" for example.
  23. */
  24. std::string version;
  25. /** Human readable name for your plugin, e.g. "Voltage Controlled Oscillator" */
  26. std::string name;
  27. std::string author;
  28. std::string license;
  29. std::string authorEmail;
  30. std::string pluginUrl;
  31. std::string authorUrl;
  32. std::string manualUrl;
  33. std::string sourceUrl;
  34. std::string donateUrl;
  35. virtual ~Plugin();
  36. void addModel(Model *model);
  37. Model *getModel(std::string slug);
  38. void fromJson(json_t *rootJ);
  39. };
  40. } // namespace plugin
  41. } // namespace rack