added master volume config value
This commit is contained in:
parent
bd226279b5
commit
b9b5ebf3f8
|
@ -14,6 +14,7 @@ public:
|
|||
|
||||
struct AudioConfig {
|
||||
std::vector<std::string> devices;
|
||||
float volume;
|
||||
};
|
||||
|
||||
struct SampleConfig {
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
"devices": [
|
||||
"VirtualMic",
|
||||
""
|
||||
]
|
||||
],
|
||||
"volume": 1.0
|
||||
},
|
||||
"shortcuts": {
|
||||
"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) {
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue