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.

48 lines
970B

  1. #pragma once
  2. #include "common.hpp"
  3. #include "math.hpp"
  4. #include "plugin/Model.hpp"
  5. #include <jansson.h>
  6. namespace rack {
  7. struct Settings {
  8. /** Runtime state, not serialized. */
  9. bool devMode = false;
  10. bool headless = false;
  11. /** Persistent state, serialized to settings.json. */
  12. std::string token;
  13. math::Vec windowSize;
  14. math::Vec windowPos;
  15. float zoom = 1.0;
  16. bool invertZoom = false;
  17. float cableOpacity = 0.5;
  18. float cableTension = 0.5;
  19. bool allowCursorLock = true;
  20. float sampleRate = 44100.0;
  21. int threadCount = 1;
  22. bool paramTooltip = false;
  23. bool cpuMeter = false;
  24. bool lockModules = false;
  25. bool checkVersion = true;
  26. float frameRateLimit = 70.0;
  27. bool frameRateSync = true;
  28. bool skipLoadOnLaunch = false;
  29. std::string patchPath;
  30. std::set<plugin::Model*> favoriteModels;
  31. json_t *toJson();
  32. void fromJson(json_t *rootJ);
  33. void save(const std::string &path);
  34. void load(const std::string &path);
  35. };
  36. extern Settings settings;
  37. } // namespace rack