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.

49 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. struct Update {
  12. std::string pluginSlug;
  13. std::string version;
  14. };
  15. void init();
  16. void destroy();
  17. void logIn(const std::string &email, const std::string &password);
  18. void logOut();
  19. void queryUpdates();
  20. void syncUpdates();
  21. void cancelDownload();
  22. bool isLoggedIn();
  23. Plugin *getPlugin(const std::string &pluginSlug);
  24. Model *getModel(const std::string &pluginSlug, const std::string &modelSlug);
  25. std::string normalizeTag(const std::string &tag);
  26. /** Checks that the slug contains only alphanumeric characters, "-", and "_" */
  27. bool isSlugValid(const std::string &slug);
  28. extern const std::set<std::string> allowedTags;
  29. extern std::vector<Plugin*> plugins;
  30. extern std::string loginStatus;
  31. extern std::vector<Update> updates;
  32. extern float downloadProgress;
  33. extern std::string downloadName;
  34. } // namespace plugin
  35. } // namespace rack