diff --git a/src/common/serialization/vst3/process-data.h b/src/common/serialization/vst3/process-data.h index 93377a73..8b70e59c 100644 --- a/src/common/serialization/vst3/process-data.h +++ b/src/common/serialization/vst3/process-data.h @@ -18,10 +18,12 @@ #include +#include #include #include #include "base.h" +#include "event-list.h" #include "parameter-changes.h" // This header provides serialization wrappers around `ProcessData` @@ -119,15 +121,16 @@ class YaAudioBusBuffers { */ struct YaProcessDataResponse { std::vector outputs; - // TODO: Don't forget to check for null before writing these back - YaParameterChanges output_parameter_changes; + std::optional output_parameter_changes; + std::optional output_events; - // TODO: Add events + // TODO: Add function to write these back to the host's `ProcessData` template void serialize(S& s) { s.container(outputs, max_num_speakers); - s.container(output_parameter_changes, 1 << 16); + s.ext(output_parameter_changes, bitsery::ext::StdOptional{}); + s.ext(output_events, bitsery::ext::StdOptional{}); } }; @@ -168,7 +171,8 @@ class YaProcessData { s.value4b(num_samples); s.container(inputs, max_num_speakers); s.container4b(outputs_num_channels, max_num_speakers); - s.container(input_parameter_changes, 1 << 16); + s.object(input_parameter_changes); + s.ext(input_events, bitsery::ext::StdOptional{}); } private: @@ -214,11 +218,14 @@ class YaProcessData { */ YaParameterChanges input_parameter_changes; + /** + * Incoming events. + */ + std::optional input_events; + // TODO: Add these (but since these require interface implementations we'll // do it in a second round) /* - IEventList* inputEvents; ///< incoming events for this block (optional) - IEventList* outputEvents; ///< outgoing events for this block (optional) ProcessContext* processContext; ///< processing context (optional, but most welcome) */