1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +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

@ -62,6 +62,11 @@ namespace
return output.writeIntBigEndian (value);
}
bool writeInt64(int64 value)
{
return output.writeInt64BigEndian(value);
}
bool writeUint64 (uint64 value)
{
return output.writeInt64BigEndian (int64 (value));
@ -72,6 +77,11 @@ namespace
return output.writeFloatBigEndian (value);
}
bool writeDouble(double value)
{
return output.writeDoubleBigEndian(value);
}
bool writeString (const String& value)
{
if (! output.writeString (value))
@ -133,10 +143,16 @@ namespace
switch (arg.getType())
{
case OSCTypes::int32: return writeInt32 (arg.getInt32());
case OSCTypes::int64: return writeInt64 (arg.getInt64());
case OSCTypes::float32: return writeFloat32 (arg.getFloat32());
case OSCTypes::double64: return writeDouble (arg.getDouble());
case OSCTypes::string: return writeString (arg.getString());
case OSCTypes::blob: return writeBlob (arg.getBlob());
case OSCTypes::colour: return writeColour (arg.getColour());
case OSCTypes::nil: return true;
case OSCTypes::impulse: return true;
case OSCTypes::T: return true;
case OSCTypes::F: return true;
default:
// In this very unlikely case you supplied an invalid OSCType!