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.

52 lines
1.1KB

  1. #pragma once
  2. #include <common.hpp>
  3. #include <math.hpp>
  4. #include <color.hpp>
  5. #include <vector>
  6. #include <map>
  7. #include <tuple>
  8. #include <jansson.h>
  9. namespace rack {
  10. /** Process-level globals. */
  11. namespace settings {
  12. /** Runtime state, not serialized. */
  13. extern bool devMode;
  14. extern bool headless;
  15. /** Persistent state, serialized to settings.json. */
  16. extern std::string token;
  17. extern math::Vec windowSize;
  18. extern math::Vec windowPos;
  19. extern float zoom;
  20. extern bool invertZoom;
  21. extern float cableOpacity;
  22. extern float cableTension;
  23. extern bool allowCursorLock;
  24. extern float sampleRate;
  25. extern int threadCount;
  26. extern bool paramTooltip;
  27. extern bool cpuMeter;
  28. extern bool lockModules;
  29. extern int frameSwapInterval;
  30. extern float autosavePeriod;
  31. extern bool skipLoadOnLaunch;
  32. extern std::string patchPath;
  33. extern std::vector<NVGcolor> cableColors;
  34. // pluginSlug -> moduleSlugs
  35. extern std::map<std::string, std::vector<std::string>> moduleWhitelist;
  36. json_t* toJson();
  37. void fromJson(json_t* rootJ);
  38. void save(const std::string& path);
  39. void load(const std::string& path);
  40. } // namespace settings
  41. } // namespace rack