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.

64 lines
1.3KB

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