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
1.8KB

  1. #pragma once
  2. #include <string>
  3. #include <list>
  4. namespace rack {
  5. struct ModuleWidget;
  6. struct Model;
  7. // Subclass this and return a pointer to a new one when init() is called
  8. struct Manufacturer {
  9. /** A list of the models available by this manufacturer, add with addModel() */
  10. std::list<Model*> models;
  11. /** The file path of the plugins directory */
  12. std::string path;
  13. /** OS-dependent library handle */
  14. void *handle = NULL;
  15. // You may set everything below this point in your plugin
  16. /** A unique identifier for the manufacturer, e.g. "foo" */
  17. std::string slug;
  18. /** Human readable name for the manufacturer, e.g. "Foo Modular" */
  19. std::string name;
  20. /** Optional metadata for the Add Module context menu */
  21. std::string homepageUrl;
  22. std::string manualUrl;
  23. std::string version;
  24. virtual ~Manufacturer();
  25. void addModel(Model *model);
  26. };
  27. struct Model {
  28. Manufacturer *manufacturer = NULL;
  29. /** A unique identifier for the model, e.g. "VCO" */
  30. std::string slug;
  31. /** Human readable name for your model, e.g. "Voltage Controlled Oscillator" */
  32. std::string name;
  33. virtual ~Model() {}
  34. virtual ModuleWidget *createModuleWidget() { return NULL; }
  35. };
  36. extern std::list<Manufacturer*> gManufacturers;
  37. extern std::string gToken;
  38. void pluginInit();
  39. void pluginDestroy();
  40. void pluginLogIn(std::string email, std::string password);
  41. void pluginLogOut();
  42. void pluginRefresh();
  43. void pluginCancelDownload();
  44. bool pluginIsLoggedIn();
  45. bool pluginIsDownloading();
  46. float pluginGetDownloadProgress();
  47. std::string pluginGetDownloadName();
  48. std::string pluginGetLoginStatus();
  49. } // namespace rack
  50. ////////////////////
  51. // Implemented by plugin
  52. ////////////////////
  53. /** Called once to initialize and return the Manufacturer instance.
  54. You must implement this in your plugin
  55. */
  56. extern "C"
  57. void init(rack::Manufacturer *manufacturer);