mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-10 04:30:12 +02:00
Implement IPlugView::canResize()
This commit is contained in:
@@ -326,6 +326,13 @@ bool Vst3Logger::log_request(bool is_host_vst,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Vst3Logger::log_request(bool is_host_vst,
|
||||||
|
const YaPlugView::CanResize& request) {
|
||||||
|
return log_request_base(is_host_vst, [&](auto& message) {
|
||||||
|
message << request.owner_instance_id << ": IPlugView::canResize()";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
bool Vst3Logger::log_request(bool is_host_vst,
|
bool Vst3Logger::log_request(bool is_host_vst,
|
||||||
const YaPluginBase::Initialize& request) {
|
const YaPluginBase::Initialize& request) {
|
||||||
return log_request_base(is_host_vst, [&](auto& message) {
|
return log_request_base(is_host_vst, [&](auto& message) {
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ class Vst3Logger {
|
|||||||
bool log_request(bool is_host_vst, const YaPlugView::OnSize&);
|
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::OnFocus&);
|
||||||
bool log_request(bool is_host_vst, const YaPlugView::SetFrame&);
|
bool log_request(bool is_host_vst, const YaPlugView::SetFrame&);
|
||||||
|
bool log_request(bool is_host_vst, const YaPlugView::CanResize&);
|
||||||
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&);
|
||||||
bool log_request(bool is_host_vst, const YaPluginFactory::Construct&);
|
bool log_request(bool is_host_vst, const YaPluginFactory::Construct&);
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ using ControlRequest = std::variant<Vst3PlugViewProxy::Destruct,
|
|||||||
YaPlugView::OnSize,
|
YaPlugView::OnSize,
|
||||||
YaPlugView::OnFocus,
|
YaPlugView::OnFocus,
|
||||||
YaPlugView::SetFrame,
|
YaPlugView::SetFrame,
|
||||||
|
YaPlugView::CanResize,
|
||||||
YaPluginBase::Initialize,
|
YaPluginBase::Initialize,
|
||||||
YaPluginBase::Terminate,
|
YaPluginBase::Terminate,
|
||||||
YaPluginFactory::Construct,
|
YaPluginFactory::Construct,
|
||||||
|
|||||||
@@ -302,6 +302,22 @@ class YaPlugView : public Steinberg::IPlugView {
|
|||||||
|
|
||||||
virtual tresult PLUGIN_API
|
virtual tresult PLUGIN_API
|
||||||
setFrame(Steinberg::IPlugFrame* frame) override = 0;
|
setFrame(Steinberg::IPlugFrame* frame) override = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message to pass through a call to `IPlugView::canResize()` to the Wine
|
||||||
|
* plugin host.
|
||||||
|
*/
|
||||||
|
struct CanResize {
|
||||||
|
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 canResize() override = 0;
|
virtual tresult PLUGIN_API canResize() override = 0;
|
||||||
virtual tresult PLUGIN_API
|
virtual tresult PLUGIN_API
|
||||||
checkSizeConstraint(Steinberg::ViewRect* rect) override = 0;
|
checkSizeConstraint(Steinberg::ViewRect* rect) override = 0;
|
||||||
|
|||||||
@@ -139,9 +139,8 @@ Vst3PlugViewProxyImpl::setFrame(Steinberg::IPlugFrame* frame) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API Vst3PlugViewProxyImpl::canResize() {
|
tresult PLUGIN_API Vst3PlugViewProxyImpl::canResize() {
|
||||||
// TODO: Implement
|
return bridge.send_message(
|
||||||
bridge.logger.log("TODO: IPlugView::canResize()");
|
YaPlugView::CanResize{.owner_instance_id = owner_instance_id()});
|
||||||
return Steinberg::kNotImplemented;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API
|
tresult PLUGIN_API
|
||||||
|
|||||||
@@ -420,6 +420,11 @@ void Vst3Bridge::run() {
|
|||||||
object_instances[request.owner_instance_id]
|
object_instances[request.owner_instance_id]
|
||||||
.plug_frame_proxy);
|
.plug_frame_proxy);
|
||||||
},
|
},
|
||||||
|
[&](YaPlugView::CanResize& request)
|
||||||
|
-> YaPlugView::CanResize::Response {
|
||||||
|
return object_instances[request.owner_instance_id]
|
||||||
|
.plug_view->canResize();
|
||||||
|
},
|
||||||
[&](YaPluginBase::Initialize& request)
|
[&](YaPluginBase::Initialize& request)
|
||||||
-> YaPluginBase::Initialize::Response {
|
-> YaPluginBase::Initialize::Response {
|
||||||
// We'll create a proxy object for the host context passed by
|
// We'll create a proxy object for the host context passed by
|
||||||
|
|||||||
Reference in New Issue
Block a user