mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-16 16:33:55 +02:00
Use mutual recursion for IEditController::setState
With this we should be able to handle `setState()`s that try to resize the currently open editor. This could pop up when using the preset browser in REAPER with plugins that recall their old size when loading a preset.
This commit is contained in:
@@ -106,6 +106,7 @@ class RunLoopTasks : public Steinberg::Linux::IEventHandler {
|
||||
class Vst3PlugViewProxyImpl : public Vst3PlugViewProxy {
|
||||
public:
|
||||
Vst3PlugViewProxyImpl(Vst3PluginBridge& bridge,
|
||||
std::atomic_bool& is_active,
|
||||
Vst3PlugViewProxy::ConstructArgs&& args);
|
||||
|
||||
/**
|
||||
@@ -201,14 +202,6 @@ class Vst3PlugViewProxyImpl : public Vst3PlugViewProxy {
|
||||
// From `IPlugViewContentScaleSupport`
|
||||
tresult PLUGIN_API setContentScaleFactor(ScaleFactor factor) override;
|
||||
|
||||
/**
|
||||
* The `IPlugFrame` object passed by the host passed to us in
|
||||
* `IPlugView::setFrame()`. When the plugin makes a callback on the
|
||||
* `IPlugFrame` proxy object, we'll pass the call through to this object.
|
||||
*/
|
||||
Steinberg::IPtr<Steinberg::IPlugFrame> plug_frame;
|
||||
|
||||
private:
|
||||
/**
|
||||
* Send a message from this `IPlugView` instance. This function will be
|
||||
* called by the host on its GUI thread, so until this function returns
|
||||
@@ -268,8 +261,25 @@ class Vst3PlugViewProxyImpl : public Vst3PlugViewProxy {
|
||||
return response_promise.get_future().get();
|
||||
}
|
||||
|
||||
/**
|
||||
* The `IPlugFrame` object passed by the host passed to us in
|
||||
* `IPlugView::setFrame()`. When the plugin makes a callback on the
|
||||
* `IPlugFrame` proxy object, we'll pass the call through to this object.
|
||||
*/
|
||||
Steinberg::IPtr<Steinberg::IPlugFrame> plug_frame;
|
||||
|
||||
private:
|
||||
Vst3PluginBridge& bridge;
|
||||
|
||||
/**
|
||||
* We'll use this to signal to the `Vst3PluginProxyImpl` that this object
|
||||
* has been destroyed. We use this to handle mutual recursion when
|
||||
* `IEditController::setState()` calls end up calling
|
||||
* `IPlugFrame::resizeView()`, which should also be handled from the GUI
|
||||
* thread.
|
||||
*/
|
||||
std::atomic_bool& is_active;
|
||||
|
||||
/**
|
||||
* The IO contexts used in `send_mutually_recursive_message()` to be able to
|
||||
* execute functions from that same calling thread while we're waiting for a
|
||||
|
||||
Reference in New Issue
Block a user