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.

51 lines
1.1KB

  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. std::string changelogUrl;
  15. float progress = 0.f;
  16. };
  17. void init();
  18. void destroy();
  19. void logIn(const std::string &email, const std::string &password);
  20. void logOut();
  21. void queryUpdates();
  22. void syncUpdate(Update *update);
  23. void syncUpdates();
  24. bool isLoggedIn();
  25. Plugin *getPlugin(const std::string &pluginSlug);
  26. Model *getModel(const std::string &pluginSlug, const std::string &modelSlug);
  27. std::string normalizeTag(const std::string &tag);
  28. /** Checks that the slug contains only alphanumeric characters, "-", and "_" */
  29. bool isSlugValid(const std::string &slug);
  30. /** Returns a string containing only the valid slug characters. */
  31. std::string normalizeSlug(const std::string &slug);
  32. extern const std::set<std::string> allowedTags;
  33. extern std::vector<Plugin*> plugins;
  34. extern std::string loginStatus;
  35. extern std::vector<Update> updates;
  36. } // namespace plugin
  37. } // namespace rack