From 33c9253b069c31b936300e074084b60059770cf9 Mon Sep 17 00:00:00 2001 From: Owen Green Date: Thu, 23 Sep 2021 11:26:40 +0100 Subject: [PATCH] Fix OSC packet construction for tuples --- include/wrapper/ArgsToClient.hpp | 6 ++++-- include/wrapper/Messaging.hpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/wrapper/ArgsToClient.hpp b/include/wrapper/ArgsToClient.hpp index c9bb1c4..bafa412 100644 --- a/include/wrapper/ArgsToClient.hpp +++ b/include/wrapper/ArgsToClient.hpp @@ -126,9 +126,11 @@ namespace client { } template - static index numTags(std::tuple&&) + static index numTags(std::tuple&& t) { - return std::tuple_size>::value; + index count = 0; + ForEach(t,[&count](auto& x){ count += numTags(x);}); + return count; } static void getTag(Packet& p, typename BufferT::type) { p.addtag('i'); } diff --git a/include/wrapper/Messaging.hpp b/include/wrapper/Messaging.hpp index 4e27305..77c4d05 100644 --- a/include/wrapper/Messaging.hpp +++ b/include/wrapper/Messaging.hpp @@ -267,7 +267,7 @@ struct FluidSCMessaging{ small_scpacket packet; packet.adds(s.c_str()); - packet.maketags(static_cast(numTags + 3)); + packet.maketags(static_cast(numTags + 2)); packet.addtag(','); packet.addtag('i'); ToOSCTypes::getTag(packet,static_cast(result));