Proxy host context menu items for VST3 plugins

This wasn't implemented yet because no plugin tried using the interface
in this way before this, but Surge XT incorporates the host's context
menu items into their own (much more elaborate) context menu. To
accommodate this, we now copy over all of the host's prepopulated
context menu items to the Wine plugin host, and calling the targets
associated with any of those items will cause the target on the
associated context menu item on the host to be called.

This is slightly more complicated than what would otherwise be necessary
because Bitwig does not assign tags to their context menu items and
instead always uses 0.
This commit is contained in:
Robbert van der Helm
2022-01-03 17:04:00 +01:00
parent 89cd1e9ee3
commit c625deadef
16 changed files with 219 additions and 107 deletions
+3 -2
View File
@@ -353,13 +353,14 @@ class Vst3PluginProxyImpl : public Vst3PluginProxy {
Steinberg::IPtr<Steinberg::Vst::IContextMenu> menu;
/**
* All targets we pass to `IContextMenu::addItem`. We'll store them per
* All targets passed to `IContextMenu::addItem`. We'll store them per
* item tag, so we can drop them together with the menu. We probably
* don't have to use smart pointers for this, but the docs are missing a
* lot of details o how this should be implemented and there's no
* example implementation around.
*/
std::unordered_map<int32, Steinberg::IPtr<YaContextMenuTarget>> targets;
std::unordered_map<int32, Steinberg::IPtr<YaContextMenuTarget>>
plugin_targets;
};
/**