1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-06 04:00:08 +00:00

Add support for types int64, double, T, F, Nil and Impulse

This also updates the UnitTest to include those types
This commit is contained in:
Ben Kuper 2024-06-22 19:53:50 +02:00
parent 61a03097ec
commit d49fee0750
8 changed files with 359 additions and 14 deletions

View file

@ -86,6 +86,12 @@ namespace
return input.readIntBigEndian();
}
int64 readInt64()
{
checkBytesAvailable(8, "OSC input stream exhausted while reading int64");
return input.readInt64BigEndian();
}
uint64 readUint64()
{
checkBytesAvailable (8, "OSC input stream exhausted while reading uint64");
@ -98,6 +104,12 @@ namespace
return input.readFloatBigEndian();
}
double readDouble64()
{
checkBytesAvailable(8, "OSC input stream exhausted while reading double");
return input.readDoubleBigEndian();
}
String readString()
{
checkBytesAvailable (4, "OSC input stream exhausted while reading string");
@ -189,10 +201,16 @@ namespace
switch (type)
{
case OSCTypes::int32: return OSCArgument (readInt32());
case OSCTypes::int64: return OSCArgument (readInt64());
case OSCTypes::float32: return OSCArgument (readFloat32());
case OSCTypes::double64: return OSCArgument (readDouble64());
case OSCTypes::string: return OSCArgument (readString());
case OSCTypes::blob: return OSCArgument (readBlob());
case OSCTypes::colour: return OSCArgument (readColour());
case OSCTypes::nil: return OSCArgument (OSCTypes::nil);
case OSCTypes::impulse: return OSCArgument (OSCTypes::impulse);
case OSCTypes::T: return OSCArgument (true);
case OSCTypes::F: return OSCArgument (false);
default:
// You supplied an invalid OSCType when calling readArgument! This should never happen.