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.

57 lines
1.3KB

  1. #pragma once
  2. #include <common.hpp>
  3. #include <map>
  4. namespace rack {
  5. /** Synchronizes plugins with the VCV Library and handles VCV accounts with the vcvrack.com API */
  6. namespace library {
  7. struct UpdateInfo {
  8. std::string name;
  9. std::string version;
  10. std::string changelogUrl;
  11. /** Only defined if plugin does not meet Rack version requirement */
  12. std::string minRackVersion;
  13. bool downloaded = false;
  14. };
  15. PRIVATE void init();
  16. PRIVATE void destroy();
  17. PRIVATE void checkAppUpdate();
  18. bool isAppUpdateAvailable();
  19. bool isLoggedIn();
  20. PRIVATE void logIn(std::string email, std::string password);
  21. PRIVATE void logOut();
  22. PRIVATE void checkUpdates();
  23. PRIVATE bool hasUpdates();
  24. PRIVATE void syncUpdate(std::string slug);
  25. PRIVATE void syncUpdates();
  26. extern std::string appVersion;
  27. extern std::string appDownloadUrl;
  28. extern std::string appChangelogUrl;
  29. extern std::string loginStatus;
  30. // plugin slug -> UpdateInfo
  31. extern std::map<std::string, UpdateInfo> updateInfos;
  32. extern std::string updateStatus;
  33. extern std::string updateSlug;
  34. extern float updateProgress;
  35. /** Whether plugins are currently downloading. */
  36. extern bool isSyncing;
  37. /** Whether the UI should ask the user to restart after updating plugins. */
  38. extern bool restartRequested;
  39. /** Whether the UI should refresh the plugin updates menu. */
  40. extern bool refreshRequested;
  41. } // namespace library
  42. } // namespace rack