Implement IPlugView::setFrame()

This commit is contained in:
Robbert van der Helm
2020-12-22 14:16:00 +01:00
parent 9288cdcb59
commit da6ddccf07
10 changed files with 83 additions and 17 deletions
+8
View File
@@ -318,6 +318,14 @@ bool Vst3Logger::log_request(bool is_host_vst,
});
}
bool Vst3Logger::log_request(bool is_host_vst,
const YaPlugView::SetFrame& request) {
return log_request_base(is_host_vst, [&](auto& message) {
message << request.owner_instance_id
<< ": IPlugView::setFrame(frame = <IPlugFrame*>)";
});
}
bool Vst3Logger::log_request(bool is_host_vst,
const YaPluginBase::Initialize& request) {
return log_request_base(is_host_vst, [&](auto& message) {
+1
View File
@@ -97,6 +97,7 @@ class Vst3Logger {
bool log_request(bool is_host_vst, const YaPlugView::GetSize&);
bool log_request(bool is_host_vst, const YaPlugView::OnSize&);
bool log_request(bool is_host_vst, const YaPlugView::OnFocus&);
bool log_request(bool is_host_vst, const YaPlugView::SetFrame&);
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 YaPluginFactory::Construct&);
+1
View File
@@ -88,6 +88,7 @@ using ControlRequest = std::variant<Vst3PlugViewProxy::Destruct,
YaPlugView::GetSize,
YaPlugView::OnSize,
YaPlugView::OnFocus,
YaPlugView::SetFrame,
YaPluginBase::Initialize,
YaPluginBase::Terminate,
YaPluginFactory::Construct,
@@ -20,6 +20,7 @@
#include "../../common.h"
#include "../base.h"
#include "../plug-frame-proxy.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
@@ -276,6 +277,29 @@ class YaPlugView : public Steinberg::IPlugView {
};
virtual tresult PLUGIN_API onFocus(TBool state) override = 0;
/**
* Message to pass through a call to `IPlugView::setFrame()` to the Wine
* plugin host. We will read what interfaces the passed `IPlugFrame` object
* implements so we can then create a proxy object on the Wine side that the
* plugin can use to make callbacks with. The lifetime of this
* `Vst3PlugFrameProxy` object should be bound to the `IPlugView` we are
* creating it for.
*/
struct SetFrame {
using Response = UniversalTResult;
native_size_t owner_instance_id;
Vst3PlugFrameProxy::ConstructArgs plug_frame_args;
template <typename S>
void serialize(S& s) {
s.value8b(owner_instance_id);
s.object(plug_frame_args);
}
};
virtual tresult PLUGIN_API
setFrame(Steinberg::IPlugFrame* frame) override = 0;
virtual tresult PLUGIN_API canResize() override = 0;