Config API: Write and reload config files
Considerations
- Would it be possible to avoid resetting the state of all sources/outputs (i.e. stopping the file players) if the output device changes?
Get current state of config
// GET /config
{
"instances": {
"instance-1": {
// Current JSON for instance here.
},
"instance-1": {
// Current JSON for instance here.
},
},
"main": {
"input": {
"deviceName": "USB Mixerboard A",
"numChannels": 2
},
"output": {
"deviceName": "Output Device A",
"numChannels": 2
},
"paths": {
"lameExecutable": "",
"html": "./html"
},
"debug": 0,
"webhook": "http://localhost:1234/",
"events": []
}
}
Update current state of config
In this example, selecting a different audio device for the main input.
// PATCH /config
{
"main": {
"input": {
"deviceName": "Different USB Mixerboard",
"numChannels": 2
}
},
// Include this to write config to JSON after updating runtime.
"write": true
}
/
to all JSON files
Write current state of // PATCH /config
{
"write": true
}
Reload config from JSON files
Useful if the JSON file has changed since the config was last loaded.
// PATCH /config
{
"reload": true
}