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.

42 lines
1.0KB

  1. #pragma once
  2. #include "common.hpp"
  3. #include "plugin/Plugin.hpp"
  4. #include "plugin/Model.hpp"
  5. #include <vector>
  6. #include <set>
  7. namespace rack {
  8. /** Plugin loader and plugin manager
  9. */
  10. namespace plugin {
  11. void init();
  12. void destroy();
  13. void logIn(const std::string &email, const std::string &password);
  14. void logOut();
  15. /** Returns whether a new plugin is available, and downloads it unless doing a dry run */
  16. bool sync(bool dryRun);
  17. void cancelDownload();
  18. bool isLoggedIn();
  19. Plugin *getPlugin(const std::string &pluginSlug);
  20. Model *getModel(const std::string &pluginSlug, const std::string &modelSlug);
  21. std::string normalizeTag(const std::string &tag);
  22. /** Checks that the slug contains only alphanumeric characters, "-", and "_" */
  23. bool isSlugValid(const std::string &slug);
  24. extern const std::set<std::string> allowedTags;
  25. extern std::vector<Plugin*> plugins;
  26. extern bool isDownloading;
  27. extern float downloadProgress;
  28. extern std::string downloadName;
  29. extern std::string loginStatus;
  30. } // namespace plugin
  31. } // namespace rack