added master volume config value
This commit is contained in:
parent
bd226279b5
commit
b9b5ebf3f8
|
@ -14,6 +14,7 @@ public:
|
||||||
|
|
||||||
struct AudioConfig {
|
struct AudioConfig {
|
||||||
std::vector<std::string> devices;
|
std::vector<std::string> devices;
|
||||||
|
float volume;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SampleConfig {
|
struct SampleConfig {
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
"devices": [
|
"devices": [
|
||||||
"VirtualMic",
|
"VirtualMic",
|
||||||
""
|
""
|
||||||
]
|
],
|
||||||
|
"volume": 1.0
|
||||||
},
|
},
|
||||||
"shortcuts": {
|
"shortcuts": {
|
||||||
"up": "Shift+Up",
|
"up": "Shift+Up",
|
||||||
|
|
|
@ -22,6 +22,7 @@ static void writeVector(json& j, const std::vector<T>& v) {
|
||||||
|
|
||||||
void from_json(const json& j, Config::AudioConfig& ac) {
|
void from_json(const json& j, Config::AudioConfig& ac) {
|
||||||
readVector(ac.devices, j.value("devices", json::array()));
|
readVector(ac.devices, j.value("devices", json::array()));
|
||||||
|
ac.volume = j.value("volume", 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void from_json(const json& j, Config::SampleConfig& sc) {
|
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();
|
json devarr = json::array();
|
||||||
writeVector(devarr, ac.devices);
|
writeVector(devarr, ac.devices);
|
||||||
j["devices"] = devarr;
|
j["devices"] = devarr;
|
||||||
|
j["volume"] = ac.volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
void to_json(json& j, const Config::SampleConfig& sc) {
|
void to_json(json& j, const Config::SampleConfig& sc) {
|
||||||
|
|
Loading…
Reference in New Issue