Refactor event receiving to optimize MIDI handlign

This keeps compatibility with some weirdly designed plugins (such as
Kontakt) while avoiding some unnecessary data transformations. Before
this we'd convert from a `DynamicVstEvents` object to a `VstEvents`
object, back to a `DynamicVstEvents` and then finally back into another
`VstEvents` object. With this change we can skip the second half of the
conversions.
This commit is contained in:
Robbert van der Helm
2020-05-01 14:06:06 +02:00
parent 506eb807af
commit ed8e3ba114
4 changed files with 215 additions and 163 deletions
+3 -3
View File
@@ -172,9 +172,9 @@ HostBridge::HostBridge(audioMasterCallback host_callback)
host_callback_handler = std::thread([&]() {
try {
while (true) {
passthrough_event(vst_host_callback,
std::pair<Logger&, bool>(logger, false),
&plugin, host_callback_function);
receive_event(
vst_host_callback, std::pair<Logger&, bool>(logger, false),
passthrough_event(&plugin, host_callback_function));
}
} catch (const boost::system::system_error&) {
// This happens when the sockets got closed because the plugin