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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. // (plugin, model) -> score
  36. extern std::map<std::tuple<std::string, std::string>, float> favoriteScores;
  37. extern std::vector<NVGcolor> cableColors;
  38. json_t *toJson();
  39. void fromJson(json_t *rootJ);
  40. void save(const std::string &path);
  41. void load(const std::string &path);
  42. } // namespace settings
  43. } // namespace rack