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.

settings.hpp 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 float frameRateLimit;
  31. extern bool frameRateSync;
  32. extern float autosavePeriod;
  33. extern bool skipLoadOnLaunch;
  34. extern std::string patchPath;
  35. extern std::vector<NVGcolor> cableColors;
  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