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.

56 lines
1.2KB

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