Allow GUIs to optionally update on a timer

Otherwise plugins can't update their editors when the GUI is being blocked.
This commit is contained in:
Robbert van der Helm
2020-03-28 18:03:20 +01:00
parent d52989acc5
commit 8ec0ed4c3c
3 changed files with 83 additions and 10 deletions
+5 -3
View File
@@ -222,10 +222,12 @@ intptr_t PluginBridge::dispatch_wrapper(AEffect* plugin,
// Because of the way the Win32 API works we have to process events
// on the same thread the window was created, and that thread is the
// thread that's handling dispatcher calls
// To allow the GUI to update even when this thread gets blocked
// (e.g. when a dropdown is open), the actual `effEditIdle` event
// gets sent to the plugin on a timer.
editor.handle_events();
return plugin->dispatcher(plugin, opcode, index, value, data,
option);
return 1;
break;
case effClose: {
// Closing the editor will also shut down the thread that's
@@ -236,7 +238,7 @@ intptr_t PluginBridge::dispatch_wrapper(AEffect* plugin,
option);
} break;
case effEditOpen: {
const auto win32_handle = editor.open();
const auto win32_handle = editor.open(plugin);
// The plugin will return 0 if it can not open its
// editor window (or if it does not support it, but in