Handle effMainsChanged on the main UI thread #75

This fixes EZdrummer not producing any sound, as the plugin presumably
schedules some task on the Win32 message loop to load its resources,
which won't happen if this is run from any other thread.
This commit is contained in:
Robbert van der Helm
2021-01-05 23:04:18 +01:00
parent 0e3b5af94e
commit 2f5d22ca17
2 changed files with 14 additions and 3 deletions
+7
View File
@@ -52,6 +52,13 @@ TODO: Add an updated screenshot with some fancy VST3-only plugins to the readme
with, and it then applies the change conditionally to be able to support with, and it then applies the change conditionally to be able to support
building with both older and newer versions of Wine. building with both older and newer versions of Wine.
### Fixed
- The function for suspending and resuming audio, `effMainsChanged()`, is now
always executed from the GUI thread. This fixes **EZdrummer** not producing
any sound as it makes the incorrect assumption that `effMainsChanged()` is
always called from the GUI thread.
### yabridgectl ### yabridgectl
- Updated for the changes in yabridge 3.0. Yabridgectl now allows you to set up - Updated for the changes in yabridge 3.0. Yabridgectl now allows you to set up
+7 -3
View File
@@ -40,10 +40,14 @@ std::mutex current_bridge_instance_mutex;
/** /**
* Opcodes that should always be handled on the main thread because they may * Opcodes that should always be handled on the main thread because they may
* involve GUI operations. * involve GUI operations.
*
* NOTE: `effMainsChanged` is the odd one here. EZdrummer interacts with the
* Win32 message loop while handling this function. If we don't execute
* this from the main GUI thread, then EZdrummer won't produce any sound.
*/ */
const std::set<int> unsafe_opcodes{effOpen, effClose, effEditGetRect, const std::set<int> unsafe_opcodes{effOpen, effClose, effEditGetRect,
effEditOpen, effEditClose, effEditIdle, effEditOpen, effEditClose, effEditIdle,
effEditTop}; effEditTop, effMainsChanged};
intptr_t VST_CALL_CONV intptr_t VST_CALL_CONV
host_callback_proxy(AEffect*, int, int, intptr_t, void*, float); host_callback_proxy(AEffect*, int, int, intptr_t, void*, float);