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.

47 lines
986B

  1. #pragma once
  2. #include "common.hpp"
  3. #include "plugin/Plugin.hpp"
  4. #include "plugin/Model.hpp"
  5. #include <list>
  6. namespace rack {
  7. struct PluginManager {
  8. std::list<Plugin*> plugins;
  9. std::string token;
  10. bool isDownloading = false;
  11. float downloadProgress = 0.f;
  12. std::string downloadName;
  13. std::string loginStatus;
  14. PluginManager(bool devMode);
  15. ~PluginManager();
  16. void logIn(std::string email, std::string password);
  17. void logOut();
  18. /** Returns whether a new plugin is available, and downloads it unless doing a dry run */
  19. bool sync(bool dryRun);
  20. void cancelDownload();
  21. bool isLoggedIn();
  22. Plugin *getPlugin(std::string pluginSlug);
  23. Model *getModel(std::string pluginSlug, std::string modelSlug);
  24. };
  25. extern PluginManager *gPluginManager;
  26. } // namespace rack
  27. ////////////////////
  28. // Implemented by plugin
  29. ////////////////////
  30. /** Called once to initialize and return the Plugin instance.
  31. You must implement this in your plugin
  32. */
  33. extern "C"
  34. void init(rack::Plugin *plugin);