added master volume config value

This commit is contained in:
mrbesen 2022-04-02 14:45:54 +02:00
parent bd226279b5
commit b9b5ebf3f8
Signed by: MrBesen
GPG Key ID: 596B2350DCD67504
3 changed files with 5 additions and 1 deletions

View File

@ -14,6 +14,7 @@ public:
struct AudioConfig {
std::vector<std::string> devices;
float volume;
};
struct SampleConfig {

View File

@ -3,7 +3,8 @@
"devices": [
"VirtualMic",
""
]
],
"volume": 1.0
},
"shortcuts": {
"up": "Shift+Up",

View File

@ -22,6 +22,7 @@ static void writeVector(json& j, const std::vector<T>& v) {
void from_json(const json& j, Config::AudioConfig& ac) {
readVector(ac.devices, j.value("devices", json::array()));
ac.volume = j.value("volume", 1.0);
}
void from_json(const json& j, Config::SampleConfig& sc) {
@ -79,6 +80,7 @@ void to_json(json& j, const Config::AudioConfig& ac) {
json devarr = json::array();
writeVector(devarr, ac.devices);
j["devices"] = devarr;
j["volume"] = ac.volume;
}
void to_json(json& j, const Config::SampleConfig& sc) {