mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-22 20:07:28 +02:00
Implement IPlugView::removed()
This commit is contained in:
@@ -257,6 +257,13 @@ bool Vst3Logger::log_request(bool is_host_vst,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Vst3Logger::log_request(bool is_host_vst,
|
||||||
|
const YaPlugView::Removed& request) {
|
||||||
|
return log_request_base(is_host_vst, [&](auto& message) {
|
||||||
|
message << request.owner_instance_id << ": IPlugView::removed()";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
bool Vst3Logger::log_request(bool is_host_vst,
|
bool Vst3Logger::log_request(bool is_host_vst,
|
||||||
const YaPlugView::GetSize& request) {
|
const YaPlugView::GetSize& request) {
|
||||||
return log_request_base(is_host_vst, [&](auto& message) {
|
return log_request_base(is_host_vst, [&](auto& message) {
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ class Vst3Logger {
|
|||||||
bool log_request(bool is_host_vst,
|
bool log_request(bool is_host_vst,
|
||||||
const YaPlugView::IsPlatformTypeSupported&);
|
const YaPlugView::IsPlatformTypeSupported&);
|
||||||
bool log_request(bool is_host_vst, const YaPlugView::Attached&);
|
bool log_request(bool is_host_vst, const YaPlugView::Attached&);
|
||||||
|
bool log_request(bool is_host_vst, const YaPlugView::Removed&);
|
||||||
bool log_request(bool is_host_vst, const YaPlugView::GetSize&);
|
bool log_request(bool is_host_vst, const YaPlugView::GetSize&);
|
||||||
bool log_request(bool is_host_vst, const YaPluginBase::Initialize&);
|
bool log_request(bool is_host_vst, const YaPluginBase::Initialize&);
|
||||||
bool log_request(bool is_host_vst, const YaPluginBase::Terminate&);
|
bool log_request(bool is_host_vst, const YaPluginBase::Terminate&);
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ using ControlRequest = std::variant<Vst3PlugViewProxy::Destruct,
|
|||||||
YaEditController::CreateView,
|
YaEditController::CreateView,
|
||||||
YaPlugView::IsPlatformTypeSupported,
|
YaPlugView::IsPlatformTypeSupported,
|
||||||
YaPlugView::Attached,
|
YaPlugView::Attached,
|
||||||
|
YaPlugView::Removed,
|
||||||
YaPlugView::GetSize,
|
YaPlugView::GetSize,
|
||||||
YaPluginBase::Initialize,
|
YaPluginBase::Initialize,
|
||||||
YaPluginBase::Terminate,
|
YaPluginBase::Terminate,
|
||||||
|
|||||||
@@ -112,6 +112,22 @@ class YaPlugView : public Steinberg::IPlugView {
|
|||||||
|
|
||||||
virtual tresult PLUGIN_API attached(void* parent,
|
virtual tresult PLUGIN_API attached(void* parent,
|
||||||
Steinberg::FIDString type) override = 0;
|
Steinberg::FIDString type) override = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message to pass through a call to `IPlugView::removed()` to the Wine
|
||||||
|
* plugin host.
|
||||||
|
*/
|
||||||
|
struct Removed {
|
||||||
|
using Response = UniversalTResult;
|
||||||
|
|
||||||
|
native_size_t owner_instance_id;
|
||||||
|
|
||||||
|
template <typename S>
|
||||||
|
void serialize(S& s) {
|
||||||
|
s.value8b(owner_instance_id);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
virtual tresult PLUGIN_API removed() override = 0;
|
virtual tresult PLUGIN_API removed() override = 0;
|
||||||
virtual tresult PLUGIN_API onWheel(float distance) override = 0;
|
virtual tresult PLUGIN_API onWheel(float distance) override = 0;
|
||||||
virtual tresult PLUGIN_API onKeyDown(char16 key,
|
virtual tresult PLUGIN_API onKeyDown(char16 key,
|
||||||
|
|||||||
@@ -59,9 +59,8 @@ tresult PLUGIN_API Vst3PlugViewProxyImpl::attached(void* parent,
|
|||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API Vst3PlugViewProxyImpl::removed() {
|
tresult PLUGIN_API Vst3PlugViewProxyImpl::removed() {
|
||||||
// TODO: Implement
|
return bridge.send_message(
|
||||||
bridge.logger.log("TODO: IPlugView::removed()");
|
YaPlugView::Removed{.owner_instance_id = owner_instance_id()});
|
||||||
return Steinberg::kNotImplemented;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API Vst3PlugViewProxyImpl::onWheel(float distance) {
|
tresult PLUGIN_API Vst3PlugViewProxyImpl::onWheel(float distance) {
|
||||||
|
|||||||
@@ -355,6 +355,21 @@ void Vst3Bridge::run() {
|
|||||||
})
|
})
|
||||||
.get();
|
.get();
|
||||||
},
|
},
|
||||||
|
[&](const YaPlugView::Removed& request)
|
||||||
|
-> YaPlugView::Removed::Response {
|
||||||
|
return main_context
|
||||||
|
.run_in_context<tresult>([&]() {
|
||||||
|
const tresult result =
|
||||||
|
object_instances[request.owner_instance_id]
|
||||||
|
.plug_view->removed();
|
||||||
|
|
||||||
|
object_instances[request.owner_instance_id]
|
||||||
|
.editor.reset();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
})
|
||||||
|
.get();
|
||||||
|
},
|
||||||
[&](YaPlugView::GetSize& request) -> YaPlugView::GetSize::Response {
|
[&](YaPlugView::GetSize& request) -> YaPlugView::GetSize::Response {
|
||||||
const tresult result =
|
const tresult result =
|
||||||
object_instances[request.owner_instance_id]
|
object_instances[request.owner_instance_id]
|
||||||
|
|||||||
Reference in New Issue
Block a user