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.

62 lines
1.3KB

  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 Plugin {
  9. virtual ~Plugin();
  10. // A unique identifier for your plugin, e.g. "foo"
  11. std::string slug;
  12. // Human readable name for your plugin, e.g. "Foo Modular"
  13. std::string name;
  14. /** A list of the models made available by this plugin */
  15. std::list<Model*> models;
  16. };
  17. struct Model {
  18. virtual ~Model() {}
  19. Plugin *plugin;
  20. // A unique identifier for the model in this plugin, e.g. "vco"
  21. std::string slug;
  22. // Human readable name for your model, e.g. "VCO"
  23. std::string name;
  24. virtual ModuleWidget *createModuleWidget() { return NULL; }
  25. };
  26. extern std::list<Plugin*> gPlugins;
  27. extern std::string gToken;
  28. void pluginInit();
  29. void pluginDestroy();
  30. void pluginLogIn(std::string email, std::string password);
  31. void pluginLogOut();
  32. void pluginRefresh();
  33. void pluginCancelDownload();
  34. bool pluginIsLoggedIn();
  35. bool pluginIsDownloading();
  36. float pluginGetDownloadProgress();
  37. std::string pluginGetDownloadName();
  38. std::string pluginGetLoginStatus();
  39. } // namespace rack
  40. ////////////////////
  41. // Implemented by plugin
  42. ////////////////////
  43. /** Called once to initialize and return Plugin.
  44. Plugin is destructed when Rack closes
  45. */
  46. extern "C"
  47. rack::Plugin *init();