OSC updates and video resolution fixes
Some checks failed
CI / Native Windows Build And Tests (push) Failing after 7s
CI / React UI Build (push) Has been cancelled
CI / Windows Release Package (push) Has been cancelled

This commit is contained in:
2026-05-03 14:33:33 +10:00
parent bfc12a1aea
commit 7dc4b552a5
20 changed files with 842 additions and 124 deletions

View File

@@ -114,7 +114,14 @@ void OscServer::ServerLoop()
OscMessage message;
std::string error;
if (DecodeMessage(buffer.data(), byteCount, message, error))
DispatchMessage(message, error);
{
if (!DispatchMessage(message, error) && !error.empty())
OutputDebugStringA(("OSC dispatch failed: " + error + "\n").c_str());
}
else if (!error.empty())
{
OutputDebugStringA(("OSC decode failed: " + error + "\n").c_str());
}
}
}
@@ -152,6 +159,17 @@ bool OscServer::DecodeMessage(const char* data, int byteCount, OscMessage& messa
return true;
}
if (valueType == 'd')
{
double value = 0.0;
if (!ReadFloat64(data, byteCount, offset, value))
return false;
std::ostringstream stream;
stream << std::setprecision(17) << value;
message.valueJson = stream.str();
return true;
}
if (valueType == 'i')
{
int value = 0;
@@ -234,6 +252,21 @@ bool OscServer::ReadFloat32(const char* data, int byteCount, int& offset, double
return true;
}
bool OscServer::ReadFloat64(const char* data, int byteCount, int& offset, double& value)
{
if (offset + 8 > byteCount)
return false;
const unsigned char* bytes = reinterpret_cast<const unsigned char*>(data + offset);
uint64_t bits = 0;
for (int index = 0; index < 8; ++index)
bits = (bits << 8) | static_cast<uint64_t>(bytes[index]);
std::memcpy(&value, &bits, sizeof(value));
offset += 8;
return true;
}
std::string OscServer::BuildJsonString(const std::string& value)
{
std::ostringstream stream;