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.
 
 

45 lines
1.1 KiB

#ifndef SCREEN_RECORDER_SETTINGS_MANAGER_HPP
#define SCREEN_RECORDER_SETTINGS_MANAGER_HPP
#define SETTINGS_KEY_PLUGIN_DIR "plugin_dir"
#define SETTINGS_KEY_OUTPUT_DIR "output_dir"
#define SETTINGS_KEY_SCREEN_ENABLED "screen_enabled"
#define SETTINGS_KEY_WEBCAM_ENABLED "webcam_enabled"
#define SETTINGS_KEY_VIDEO_DEVICE_ID "video_device_id"
#define SETTINGS_KEY_AUDIO_ENABLED "audio_enabled"
#define SETTINGS_KEY_AUDIO_DEVICE_ID "audio_device_id"
#define SETTINGS_DEFAULT_PLUGIN_DIR "/usr/lib/x86_64-linux-gnu/obs-plugins/"
#include <iostream>
#include <list>
using namespace std;
class SettingsEntry
{
public:
string key;
string value;
};
class SettingsManager
{
public:
SettingsManager();
virtual ~SettingsManager();
void Update(string key, string value);
void UpdateBool(string key, bool value);
void Save(string key, string value);
void SaveAll();
string Get(string key);
string GetWithDefault(string key, string defaultValue);
bool GetBool(string key);
bool GetBoolWithDefault(string key, bool defaultValue);
private:
list<SettingsEntry*> settings;
void readAll();
void saveAll();
};
#endif