Avoid allocations in VST3 process response

This is very ugly so hopefully I can think of a neater way, but now the
response object is just a set of pointers, so we can avoid all copies
and moves on the Wine side.
This commit is contained in:
Robbert van der Helm
2021-05-07 19:24:28 +02:00
parent 93b8643cba
commit f1d7b7bf57
6 changed files with 139 additions and 77 deletions
@@ -222,7 +222,7 @@ class YaAudioProcessor : public Steinberg::Vst::IAudioProcessor {
*/
struct ProcessResponse {
UniversalTResult result;
YaProcessDataResponse output_data;
YaProcessData::Response output_data;
template <typename S>
void serialize(S& s) {
@@ -238,8 +238,9 @@ class YaAudioProcessor : public Steinberg::Vst::IAudioProcessor {
* provided by the host so we can send it to the Wine plugin host. We can
* then use `YaProcessData::reconstruct()` on the Wine plugin host side to
* reconstruct the original `ProcessData` object, and we then finally use
* `YaProcessData::move_outputs_to_response()` to create a response object
* that we can write back to the `ProcessData` object provided by the host.
* `YaProcessData::create_response()` to create a response object that we
* can write the plugin's changes back to the `ProcessData` object provided
* by the host.
*/
struct Process {
using Response = ProcessResponse;