Update the context menu status

This commit is contained in:
Robbert van der Helm
2021-01-07 20:22:32 +01:00
parent 3d690a370b
commit 25af73c86e
3 changed files with 7 additions and 3 deletions
@@ -34,9 +34,6 @@
* the user clicks on them. As far as I'm aware, not a single Linux VST3 host
* implements `IComponentHandler3` and thus provides support for these context
* menus.
*
* TODO: None of this has been tested because I have not run into any plugins
* that use `IComponentHandler3` yet.
*/
class Vst3ContextMenuProxy : public YaContextMenu {
public:
+5
View File
@@ -195,6 +195,11 @@ Vst3PluginBridge::Vst3PluginBridge()
},
[&](const YaContextMenu::Popup& request)
-> YaContextMenu::Popup::Response {
// FIXME: In REAPER having the menu open without interacting
// with it causes malloc failures or failing font
// drawing calls. Valgrind reports all kinds of
// memory errors within REAPER when this happens, and
// I'm not sure if yabridge is to blame here.
return plugin_proxies.at(request.owner_instance_id)
.get()
.context_menus.at(request.context_menu_id)
@@ -70,6 +70,8 @@ tresult PLUGIN_API Vst3ContextMenuProxyImpl::getItem(
tresult PLUGIN_API
Vst3ContextMenuProxyImpl::addItem(const Steinberg::Vst::IContextMenuItem& item,
Steinberg::Vst::IContextMenuTarget* target) {
// TODO: I haven't come across a plugin that adds its own items, so this
// hasn't been tested yet
const tresult result = bridge.send_message(YaContextMenu::AddItem{
.owner_instance_id = owner_instance_id(),
.context_menu_id = context_menu_id(),