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.

Plugin.hpp 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include "common.hpp"
  3. #include <jansson.h>
  4. #include <list>
  5. namespace rack {
  6. struct Model;
  7. // Subclass this and return a pointer to a new one when init() is called
  8. struct Plugin {
  9. /** A list of the models available by this plugin, add with addModel() */
  10. std::list<Model*> models;
  11. /** The file path of the plugin's directory */
  12. std::string path;
  13. /** OS-dependent library handle */
  14. void *handle = NULL;
  15. /** Must be unique. Used for patch files and the VCV store API.
  16. To guarantee uniqueness, it is a good idea to prefix the slug by your "company name" if available, e.g. "MyCompany-MyPlugin"
  17. */
  18. std::string slug;
  19. /** The version of your plugin
  20. Plugins should follow the versioning scheme described at https://github.com/VCVRack/Rack/issues/266
  21. Do not include the "v" in "v1.0" for example.
  22. */
  23. std::string version;
  24. /** Human readable name for your plugin, e.g. "Voltage Controlled Oscillator" */
  25. std::string name;
  26. std::string author;
  27. std::string license;
  28. std::string authorEmail;
  29. std::string pluginUrl;
  30. std::string authorUrl;
  31. std::string manualUrl;
  32. std::string sourceUrl;
  33. std::string donateUrl;
  34. virtual ~Plugin();
  35. void addModel(Model *model);
  36. Model *getModel(std::string slug);
  37. void fromJson(json_t *rootJ);
  38. };
  39. } // namespace rack