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.

plugin.hpp 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #include <common.hpp>
  3. #include <plugin/Plugin.hpp>
  4. #include <plugin/Model.hpp>
  5. #include <vector>
  6. namespace rack {
  7. /** Plugin loader and plugin manager
  8. */
  9. namespace plugin {
  10. struct Update {
  11. std::string pluginSlug;
  12. std::string pluginName;
  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. bool isLoggedIn();
  22. void queryUpdates();
  23. bool hasUpdates();
  24. void syncUpdate(Update* update);
  25. void syncUpdates();
  26. bool isSyncing();
  27. Plugin* getPlugin(const std::string& pluginSlug);
  28. Model* getModel(const std::string& pluginSlug, const std::string& modelSlug);
  29. /** Checks that the slug contains only alphanumeric characters, "-", and "_" */
  30. bool isSlugValid(const std::string& slug);
  31. /** Returns a string containing only the valid slug characters. */
  32. std::string normalizeSlug(const std::string& slug);
  33. extern std::vector<Plugin*> plugins;
  34. extern std::string loginStatus;
  35. extern std::vector<Update> updates;
  36. extern std::string updateStatus;
  37. extern bool restartRequested;
  38. } // namespace plugin
  39. } // namespace rack