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.

44 lines
1.1 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. #ifndef SCREEN_RECORDER_SETTINGS_MANAGER_HPP
  2. #define SCREEN_RECORDER_SETTINGS_MANAGER_HPP
  3. #define SETTINGS_KEY_PLUGIN_DIR "plugin_dir"
  4. #define SETTINGS_KEY_OUTPUT_DIR "output_dir"
  5. #define SETTINGS_KEY_SCREEN_ENABLED "screen_enabled"
  6. #define SETTINGS_KEY_WEBCAM_ENABLED "webcam_enabled"
  7. #define SETTINGS_KEY_VIDEO_DEVICE_ID "video_device_id"
  8. #define SETTINGS_KEY_AUDIO_ENABLED "audio_enabled"
  9. #define SETTINGS_DEFAULT_PLUGIN_DIR "/usr/lib/x86_64-linux-gnu/obs-plugins/"
  10. #include <iostream>
  11. #include <list>
  12. using namespace std;
  13. class SettingsEntry
  14. {
  15. public:
  16. string key;
  17. string value;
  18. };
  19. class SettingsManager
  20. {
  21. public:
  22. SettingsManager();
  23. virtual ~SettingsManager();
  24. void Update(string key, string value);
  25. void UpdateBool(string key, bool value);
  26. void Save(string key, string value);
  27. void SaveAll();
  28. string Get(string key);
  29. string GetWithDefault(string key, string defaultValue);
  30. bool GetBool(string key);
  31. bool GetBoolWithDefault(string key, bool defaultValue);
  32. private:
  33. list<SettingsEntry*> settings;
  34. void readAll();
  35. void saveAll();
  36. };
  37. #endif