Implement Vst3ContextMenuProxyImpl destructor

This commit is contained in:
Robbert van der Helm
2021-01-06 22:50:56 +01:00
parent b9d4bd6042
commit 5dffba4584
5 changed files with 25 additions and 7 deletions
+10
View File
@@ -924,6 +924,16 @@ bool Vst3Logger::log_request(bool is_host_vst,
});
}
bool Vst3Logger::log_request(bool is_host_vst,
const Vst3ContextMenuProxy::Destruct& request) {
return log_request_base(is_host_vst, [&](auto& message) {
// We don't know what class this instance was originally instantiated
// as, but it also doesn't really matter
message << request.owner_instance_id << ": <IContextMenu #"
<< request.context_menu_id << ">::~IContextMenu()";
});
}
bool Vst3Logger::log_request(bool is_host_vst, const WantsConfiguration&) {
return log_request_base(is_host_vst, [&](auto& message) {
message << "Requesting <Configuration>";
+1
View File
@@ -170,6 +170,7 @@ class Vst3Logger {
bool log_request(bool is_host_vst, const YaComponent::ActivateBus&);
bool log_request(bool is_host_vst, const YaComponent::SetActive&);
bool log_request(bool is_host_vst, const Vst3ContextMenuProxy::Destruct&);
bool log_request(bool is_host_vst, const WantsConfiguration&);
bool log_request(bool is_host_vst, const YaComponentHandler::BeginEdit&);
bool log_request(bool is_host_vst, const YaComponentHandler::PerformEdit&);
+2 -1
View File
@@ -170,7 +170,8 @@ void serialize(S& s, AudioProcessorRequest& payload) {
* information we want or the operation we want to perform. A request of type
* `CallbackRequest(T)` should send back a `T::Response`.
*/
using CallbackRequest = std::variant<WantsConfiguration,
using CallbackRequest = std::variant<Vst3ContextMenuProxy::Destruct,
WantsConfiguration,
YaComponentHandler::BeginEdit,
YaComponentHandler::PerformEdit,
YaComponentHandler::EndEdit,
+9
View File
@@ -49,6 +49,15 @@ Vst3PluginBridge::Vst3PluginBridge()
sockets.vst_host_callback.receive_messages(
std::pair<Vst3Logger&, bool>(logger, false),
overload{
[&](const Vst3ContextMenuProxy::Destruct& request)
-> Vst3ContextMenuProxy::Destruct::Response {
assert(
plugin_proxies.at(request.owner_instance_id)
.get()
.unregister_context_menu(request.context_menu_id));
return Ack{};
},
[&](const WantsConfiguration&) -> WantsConfiguration::Response {
return config;
},
@@ -26,12 +26,9 @@ Vst3ContextMenuProxyImpl::Vst3ContextMenuProxyImpl(
Vst3ContextMenuProxyImpl::~Vst3ContextMenuProxyImpl() {
// Also drop the context menu smart pointer on plugin side when this gets
// dropped
// TODO: Uncomment when we implement this
// bridge.send_message(
// Vst3ContextMenuProxy::Destruct{.owner_instance_id =
// owner_instance_id(),
// .context_menu_id =
// context_menu_id()});
bridge.send_message(
Vst3ContextMenuProxy::Destruct{.owner_instance_id = owner_instance_id(),
.context_menu_id = context_menu_id()});
}
tresult PLUGIN_API