Implement the plugin side if IComponentHandler3

This commit is contained in:
Robbert van der Helm
2021-01-06 22:25:23 +01:00
parent 79319413f5
commit 9e3c57476c
5 changed files with 101 additions and 1 deletions
@@ -39,6 +39,26 @@ Vst3PluginProxyImpl::queryInterface(const Steinberg::TUID _iid, void** obj) {
return result;
}
size_t Vst3PluginProxyImpl::register_context_menu(
Steinberg::IPtr<Steinberg::Vst::IContextMenu> menu) {
std::lock_guard lock(context_menus_mutex);
const size_t context_menu_id = current_context_menu_id.fetch_add(1);
context_menus.emplace(context_menu_id, std::move(menu));
return context_menu_id;
}
/**
* Unregister a context menu using the ID generated by a previous call to
* `register_context_menu()`. This will release the context menu object
* returned by the host.
*/
bool Vst3PluginProxyImpl::unregister_context_menu(size_t context_menu_id) {
std::lock_guard lock(context_menus_mutex);
return context_menus.erase(context_menu_id);
}
tresult PLUGIN_API Vst3PluginProxyImpl::setAudioPresentationLatencySamples(
Steinberg::Vst::BusDirection dir,
int32 busIndex,
@@ -373,6 +393,7 @@ tresult PLUGIN_API Vst3PluginProxyImpl::setComponentHandler(
// Automatically converted smart pointers for when the plugin performs a
// callback later
component_handler_2 = component_handler;
component_handler_3 = component_handler;
unit_handler = component_handler;
return bridge.send_message(YaEditController::SetComponentHandler{