mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-13 20:09:59 +02:00
Rework Vst3MessageHandler::receive_messages
This now takes a regular overloaded function and the visiting is done in `receive_messages()` itself. This way we can use templates to ensure that the return type is correct. Otherwise auto will cause issues in the future when we want to return multiple concrete types from a function that takes a single variant. The alternative would be both receiving a variant as a parameter and then returning another variant as a result, but that is much less type safe.
This commit is contained in:
@@ -78,13 +78,8 @@ Vst3PluginBridge::Vst3PluginBridge()
|
||||
host_callback_handler = std::jthread([&]() {
|
||||
sockets.vst_host_callback.receive_messages(
|
||||
std::pair<Vst3Logger&, bool>(logger, false),
|
||||
[&](CallbackRequest request) -> auto {
|
||||
return std::visit(overload{[&](const WantsConfiguration&)
|
||||
-> WantsConfiguration::Response {
|
||||
return config;
|
||||
}},
|
||||
request);
|
||||
});
|
||||
overload{[&](const WantsConfiguration&)
|
||||
-> WantsConfiguration::Response { return config; }});
|
||||
});
|
||||
|
||||
// Set up the plugin factory, since this is the first thing the host will
|
||||
|
||||
Reference in New Issue
Block a user