Run events async and centralized for group hosts

At a 30 fps rate with a limit on the number of window messages per
frame. This is somehow needed for Melda plugins, as they otherwise
dispatch tiemr messages indefinitely after opening a second editor with
seemingly no way around it.

With this and some refactoring #15 should be almost done.
This commit is contained in:
Robbert van der Helm
2020-05-26 12:09:27 +02:00
parent 16fce5577d
commit 198807a15a
4 changed files with 122 additions and 64 deletions
+15
View File
@@ -183,6 +183,13 @@ class GroupBridge {
*/
void accept_requests();
/**
* Handle both Win32 messages and X11 events on a timer within the IO
* context. This is a centralized replacement for the event handling in
* `Vst2Bridge::handle_dispatch_single` for plugin groups.
*/
void async_handle_events();
/**
* Continuously read from a pipe and write the output to the log file. Used
* with the IO streams captured by `stdout_redirect` and `stderr_redirect`.
@@ -268,6 +275,14 @@ class GroupBridge {
*/
std::mutex active_plugins_mutex;
/**
* A timer used to repeatedly handle the Win32 message loop and the X11
* events.
*
8 @see async_handle_events
*/
boost::asio::steady_timer events_timer;
/**
* A timer to defer shutting down the process, allowing for fast plugin
* scanning without having to start a new group host process for each