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.

66 lines
1.4KB

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