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.0KB

  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 bool realTime;
  25. extern float sampleRate;
  26. extern int threadCount;
  27. extern bool paramTooltip;
  28. extern bool cpuMeter;
  29. extern bool lockModules;
  30. extern int frameSwapInterval;
  31. extern float autosavePeriod;
  32. extern bool skipLoadOnLaunch;
  33. extern std::string patchPath;
  34. extern std::vector<NVGcolor> cableColors;
  35. json_t* toJson();
  36. void fromJson(json_t* rootJ);
  37. void save(const std::string& path);
  38. void load(const std::string& path);
  39. } // namespace settings
  40. } // namespace rack