mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-06-16 08:23:55 +02:00
Implement IPlugView::checkSizeConstraint()
With this the whole of `IPlugView` and thus also `IEditController` is implemented.
This commit is contained in:
@@ -19,7 +19,6 @@ incomplete list of things that still have to be done before this can be used:
|
|||||||
- `IHostApplication::createComponent()`
|
- `IHostApplication::createComponent()`
|
||||||
- `IConnectionPoint::notify()`, and support for indirectly connecting
|
- `IConnectionPoint::notify()`, and support for indirectly connecting
|
||||||
components through message passing proxies
|
components through message passing proxies
|
||||||
- The rest of `IPlugView`
|
|
||||||
- `IEditController2`
|
- `IEditController2`
|
||||||
- All other mandatory interfaces
|
- All other mandatory interfaces
|
||||||
- All other optional interfaces
|
- All other optional interfaces
|
||||||
|
|||||||
@@ -333,6 +333,18 @@ bool Vst3Logger::log_request(bool is_host_vst,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Vst3Logger::log_request(bool is_host_vst,
|
||||||
|
const YaPlugView::CheckSizeConstraint& request) {
|
||||||
|
return log_request_base(is_host_vst, [&](auto& message) {
|
||||||
|
message << request.owner_instance_id
|
||||||
|
<< ": IPlugView::checkSizeConstraint(rect = "
|
||||||
|
"<ViewRect* with left = "
|
||||||
|
<< request.rect.left << ", top = " << request.rect.top
|
||||||
|
<< ", right = " << request.rect.right
|
||||||
|
<< ", bottom = " << request.rect.bottom << ">)";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
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) {
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ class Vst3Logger {
|
|||||||
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 YaPlugView::CanResize&);
|
||||||
|
bool log_request(bool is_host_vst, const YaPlugView::CheckSizeConstraint&);
|
||||||
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&);
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ using ControlRequest = std::variant<Vst3PlugViewProxy::Destruct,
|
|||||||
YaPlugView::OnFocus,
|
YaPlugView::OnFocus,
|
||||||
YaPlugView::SetFrame,
|
YaPlugView::SetFrame,
|
||||||
YaPlugView::CanResize,
|
YaPlugView::CanResize,
|
||||||
|
YaPlugView::CheckSizeConstraint,
|
||||||
YaPluginBase::Initialize,
|
YaPluginBase::Initialize,
|
||||||
YaPluginBase::Terminate,
|
YaPluginBase::Terminate,
|
||||||
YaPluginFactory::Construct,
|
YaPluginFactory::Construct,
|
||||||
|
|||||||
@@ -319,6 +319,25 @@ class YaPlugView : public Steinberg::IPlugView {
|
|||||||
};
|
};
|
||||||
|
|
||||||
virtual tresult PLUGIN_API canResize() override = 0;
|
virtual tresult PLUGIN_API canResize() override = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message to pass through a call to `IPlugView::checkSizeConstraint(rect)`
|
||||||
|
* to the Wine plugin host.
|
||||||
|
*/
|
||||||
|
struct CheckSizeConstraint {
|
||||||
|
using Response = UniversalTResult;
|
||||||
|
|
||||||
|
native_size_t owner_instance_id;
|
||||||
|
|
||||||
|
Steinberg::ViewRect rect;
|
||||||
|
|
||||||
|
template <typename S>
|
||||||
|
void serialize(S& s) {
|
||||||
|
s.value8b(owner_instance_id);
|
||||||
|
s.object(rect);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
virtual tresult PLUGIN_API
|
virtual tresult PLUGIN_API
|
||||||
checkSizeConstraint(Steinberg::ViewRect* rect) override = 0;
|
checkSizeConstraint(Steinberg::ViewRect* rect) override = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,13 @@ tresult PLUGIN_API Vst3PlugViewProxyImpl::canResize() {
|
|||||||
|
|
||||||
tresult PLUGIN_API
|
tresult PLUGIN_API
|
||||||
Vst3PlugViewProxyImpl::checkSizeConstraint(Steinberg::ViewRect* rect) {
|
Vst3PlugViewProxyImpl::checkSizeConstraint(Steinberg::ViewRect* rect) {
|
||||||
// TODO: Implement
|
if (rect) {
|
||||||
bridge.logger.log("TODO: IPlugView::checkSizeConstraint()");
|
return bridge.send_message(YaPlugView::CheckSizeConstraint{
|
||||||
return Steinberg::kNotImplemented;
|
.owner_instance_id = owner_instance_id(), .rect = *rect});
|
||||||
|
} else {
|
||||||
|
bridge.logger.log(
|
||||||
|
"WARNING: Null pointer passed to "
|
||||||
|
"'IPlugView::checkSizeConstraint()'");
|
||||||
|
return Steinberg::kInvalidArgument;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -425,6 +425,11 @@ void Vst3Bridge::run() {
|
|||||||
return object_instances[request.owner_instance_id]
|
return object_instances[request.owner_instance_id]
|
||||||
.plug_view->canResize();
|
.plug_view->canResize();
|
||||||
},
|
},
|
||||||
|
[&](YaPlugView::CheckSizeConstraint& request)
|
||||||
|
-> YaPlugView::CheckSizeConstraint::Response {
|
||||||
|
return object_instances[request.owner_instance_id]
|
||||||
|
.plug_view->checkSizeConstraint(&request.rect);
|
||||||
|
},
|
||||||
[&](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