OSC stubs
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user