diff --git a/src/common/communication/vst2.h b/src/common/communication/vst2.h index c0847b54..33435400 100644 --- a/src/common/communication/vst2.h +++ b/src/common/communication/vst2.h @@ -504,6 +504,7 @@ Vst2EventResult passthrough_event(AEffect* plugin, [](VstIOProperties& props) -> void* { return &props; }, [](VstMidiKeyName& key_name) -> void* { return &key_name; }, [](VstParameterProperties& props) -> void* { return &props; }, + [](VstPatchChunkInfo& info) -> void* { return &info; }, [&](const WantsVstRect&) -> void* { return string_buffer.data(); }, [](const WantsVstTimeInfo&) -> void* { return nullptr; }, [&](const WantsString&) -> void* { return string_buffer.data(); }}; diff --git a/src/common/logging/vst2.cpp b/src/common/logging/vst2.cpp index b82b2acb..196adfe5 100644 --- a/src/common/logging/vst2.cpp +++ b/src/common/logging/vst2.cpp @@ -445,6 +445,10 @@ void Vst2Logger::log_event( [&](const VstParameterProperties&) { message << ""; }, + [&](const VstPatchChunkInfo& info) { + message << ""; + }, [&](const WantsAEffectUpdate&) { message << "nullptr"; }, [&](const WantsAudioShmBufferConfig&) { message << "nullptr"; }, [&](const WantsChunkBuffer&) { diff --git a/src/common/serialization/vst2.h b/src/common/serialization/vst2.h index c435c112..849c212d 100644 --- a/src/common/serialization/vst2.h +++ b/src/common/serialization/vst2.h @@ -444,6 +444,7 @@ struct Vst2Event { VstIOProperties, VstMidiKeyName, VstParameterProperties, + VstPatchChunkInfo, WantsVstRect, WantsVstTimeInfo, WantsString>; @@ -642,6 +643,15 @@ void serialize(S& s, VstParameterProperties& props) { s.container1b(props.future); } +template +void serialize(S& s, VstPatchChunkInfo& info) { + s.value4b(info.version); + s.value4b(info.pluginUniqueID); + s.value4b(info.pluginVersion); + s.value4b(info.numElements); + s.container1b(info.future); +} + template void serialize(S& s, VstRect& rect) { s.value2b(rect.top); diff --git a/src/plugin/bridges/vst2.cpp b/src/plugin/bridges/vst2.cpp index 76ab7338..e8cde958 100644 --- a/src/plugin/bridges/vst2.cpp +++ b/src/plugin/bridges/vst2.cpp @@ -266,6 +266,10 @@ class DispatchDataConverter : public DefaultDataConverter { return ChunkData{ std::vector(chunk_data, chunk_data + value)}; } break; + case effBeginLoadBank: + case effBeginLoadProgram: + return *static_cast(data); + break; case effProcessEvents: return DynamicVstEvents(*static_cast(data)); break; diff --git a/src/wine-host/bridges/vst2.cpp b/src/wine-host/bridges/vst2.cpp index c14d20a8..8b1e6f13 100644 --- a/src/wine-host/bridges/vst2.cpp +++ b/src/wine-host/bridges/vst2.cpp @@ -100,9 +100,10 @@ static const std::unordered_set safe_mutually_recursive_requests{ * this on the main thread introduces any regressions. */ static const std::unordered_set unsafe_requests{ - effOpen, effClose, effEditGetRect, effEditOpen, - effEditClose, effEditIdle, effEditTop, effMainsChanged, - effGetChunk, effSetChunk, effSetSampleRate, effSetBlockSize}; + effOpen, effClose, effEditGetRect, effEditOpen, + effEditClose, effEditIdle, effEditTop, effMainsChanged, + effGetChunk, effSetChunk, effBeginLoadBank, effBeginLoadProgram, + effSetSampleRate, effSetBlockSize}; /** * These opcodes from `unsafe_requests` should be run under realtime scheduling @@ -622,10 +623,9 @@ class HostCallbackDataConverter : public DefaultDataConverter { return DefaultDataConverter::write_value(opcode, value, response); } - Vst2EventResult send_event( - asio::local::stream_protocol::socket& socket, - const Vst2Event& event, - SerializationBufferBase& buffer) const override { + Vst2EventResult send_event(asio::local::stream_protocol::socket& socket, + const Vst2Event& event, + SerializationBufferBase& buffer) const override { if (mutually_recursive_callbacks.contains(event.opcode)) { return mutual_recursion_.fork([&]() { return DefaultDataConverter::send_event(socket, event, buffer);