From 384805ac41841554c0f88472f30e0ac67e71922c Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Thu, 7 May 2020 16:35:11 +0200 Subject: [PATCH] Add serialization for speaker arrangements --- src/common/serialization.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/common/serialization.h b/src/common/serialization.h index def47b34..750ead55 100644 --- a/src/common/serialization.h +++ b/src/common/serialization.h @@ -246,6 +246,14 @@ class alignas(16) DynamicSpeakerArrangement { */ std::vector speakers; + template + void serialize(S& s) { + s.value4b(flags); + s.container( + speakers, max_audio_channels, + [](S& s, VstSpeaker& speaker) { s.container1b(speaker.data); }); + } + private: /** * Some buffer we can build a `VstSpeakerArrangement` object in. This object @@ -298,9 +306,9 @@ struct WantsString {}; * clarity's sake. * * - A byte vector for handling chunk data during `effSetChunk()`. We can't - reuse the regular string handling here since the data may contain null - bytes and `std::string::as_c_str()` might cut off everything after the - first null byte. + * reuse the regular string handling here since the data may contain null + * bytes and `std::string::as_c_str()` might cut off everything after the + * first null byte. * - An X11 window handle. * - Specific data structures from `aeffextx.h`. For instance an event with the * opcode `effProcessEvents` the hosts passes a `VstEvents` struct containing