OSC stubs
All checks were successful
CI / React UI Build (push) Successful in 12s
CI / Native Windows Build And Tests (push) Successful in 2m11s
CI / Windows Release Package (push) Has been skipped

This commit is contained in:
Aiden
2026-05-30 20:42:38 +10:00
parent 04e0802ef2
commit 0f3db3ba1b
18 changed files with 298 additions and 16 deletions

View File

@@ -51,6 +51,17 @@ void ApplyPort(const JsonValue& root, const char* key, unsigned short& target)
target = static_cast<unsigned short>(port);
}
void ApplyOptionalPort(const JsonValue& root, const char* key, unsigned short& target)
{
const JsonValue* value = Find(root, key);
if (!value || !value->isNumber())
return;
const double port = value->asNumber();
if (port >= 0.0 && port <= 65535.0)
target = static_cast<unsigned short>(port);
}
JsonValue NumberValue(double value)
{
return JsonValue(value);
@@ -136,7 +147,7 @@ bool ApplyAppConfigJson(const JsonValue& root, AppConfig& config, std::string* e
ApplyString(root, "shaderLibrary", config.shaderLibrary);
ApplyPort(root, "serverPort", config.http.preferredPort);
ApplyString(root, "oscBindAddress", config.oscBindAddress);
ApplyPort(root, "oscPort", config.oscPort);
ApplyOptionalPort(root, "oscPort", config.oscPort);
ApplyDouble(root, "oscSmoothing", config.oscSmoothing);
ApplyInputConfig(root, config);
ApplyOutputConfig(root, config);