Pass pointers to IMessage objects around

Instead of serializing the actual `YaMessage`, for the reasons mentioned
in the comments. This was needed to stop iZotope VocalSynth 2 in Ardour
from segfaulting when editing parameters, because that plugin is
apparently being very naughty.
This commit is contained in:
Robbert van der Helm
2020-12-28 13:19:34 +01:00
parent 2c3312b452
commit 4226ab6e43
9 changed files with 181 additions and 53 deletions
@@ -55,15 +55,14 @@ Vst3ConnectionPointProxyImpl::disconnect(IConnectionPoint* /*other*/) {
tresult PLUGIN_API
Vst3ConnectionPointProxyImpl::notify(Steinberg::Vst::IMessage* message) {
// As explained in `YaMessage` and `Vst3PluginProxyImpl::notify`, we can
// only support our own `IMessage implementation here`
if (auto message_impl = dynamic_cast<YaMessage*>(message)) {
return bridge.send_message(YaConnectionPoint::Notify{
.instance_id = owner_instance_id(), .message = *message_impl});
if (message) {
return bridge.send_message(
YaConnectionPoint::Notify{.instance_id = owner_instance_id(),
.message_ptr = YaMessagePtr(*message)});
} else {
std::cerr << "WARNING: Unknown message type passed to "
std::cerr << "WARNING: Null pointer passed to "
"'IConnectionPoint::notify()', ignoring"
<< std::endl;
return Steinberg::kNotImplemented;
return Steinberg::kInvalidArgument;
}
}