mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
Store the actual context menu proxy impls
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "vst3-impls/component-handler-proxy.h"
|
#include "vst3-impls/component-handler-proxy.h"
|
||||||
#include "vst3-impls/connection-point-proxy.h"
|
#include "vst3-impls/connection-point-proxy.h"
|
||||||
|
#include "vst3-impls/context-menu-proxy.h"
|
||||||
#include "vst3-impls/host-context-proxy.h"
|
#include "vst3-impls/host-context-proxy.h"
|
||||||
#include "vst3-impls/plug-frame-proxy.h"
|
#include "vst3-impls/plug-frame-proxy.h"
|
||||||
|
|
||||||
@@ -858,14 +859,14 @@ void Vst3Bridge::handle_win32_events() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Vst3Bridge::register_context_menu(Vst3ContextMenuProxy& context_menu) {
|
void Vst3Bridge::register_context_menu(Vst3ContextMenuProxyImpl& context_menu) {
|
||||||
std::lock_guard lock(object_instances[context_menu.owner_instance_id()]
|
std::lock_guard lock(object_instances[context_menu.owner_instance_id()]
|
||||||
.registered_context_menus_mutex);
|
.registered_context_menus_mutex);
|
||||||
|
|
||||||
object_instances[context_menu.owner_instance_id()]
|
object_instances[context_menu.owner_instance_id()]
|
||||||
.registered_context_menus.emplace(
|
.registered_context_menus.emplace(
|
||||||
context_menu.context_menu_id(),
|
context_menu.context_menu_id(),
|
||||||
std::ref<Vst3ContextMenuProxy>(context_menu));
|
std::ref<Vst3ContextMenuProxyImpl>(context_menu));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Vst3Bridge::unregister_context_menu(size_t object_instance_id,
|
void Vst3Bridge::unregister_context_menu(size_t object_instance_id,
|
||||||
|
|||||||
@@ -26,6 +26,9 @@
|
|||||||
#include "../editor.h"
|
#include "../editor.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
// Forward declarations
|
||||||
|
class Vst3ContextMenuProxyImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A holder for an object instance's `IPlugView` object and all smart pointers
|
* A holder for an object instance's `IPlugView` object and all smart pointers
|
||||||
* casted from it.
|
* casted from it.
|
||||||
@@ -114,7 +117,7 @@ struct InstanceInterfaces {
|
|||||||
* @relates Vst3Bridge::register_context_menu
|
* @relates Vst3Bridge::register_context_menu
|
||||||
* @relates Vst3Bridge::unregister_context_menu
|
* @relates Vst3Bridge::unregister_context_menu
|
||||||
*/
|
*/
|
||||||
std::map<size_t, std::reference_wrapper<Vst3ContextMenuProxy>>
|
std::map<size_t, std::reference_wrapper<Vst3ContextMenuProxyImpl>>
|
||||||
registered_context_menus;
|
registered_context_menus;
|
||||||
std::mutex registered_context_menus_mutex;
|
std::mutex registered_context_menus_mutex;
|
||||||
|
|
||||||
@@ -310,7 +313,7 @@ class Vst3Bridge : public HostBridge {
|
|||||||
* `object_instances`. This will be called during the constructor of
|
* `object_instances`. This will be called during the constructor of
|
||||||
* `Vst3ContextMenuProxyImpl` so we can refer to the exact instance later.
|
* `Vst3ContextMenuProxyImpl` so we can refer to the exact instance later.
|
||||||
*/
|
*/
|
||||||
void register_context_menu(Vst3ContextMenuProxy& context_menu);
|
void register_context_menu(Vst3ContextMenuProxyImpl& context_menu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove a previously registered context menu from `object_instances`. This
|
* Remove a previously registered context menu from `object_instances`. This
|
||||||
|
|||||||
Reference in New Issue
Block a user