mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 12:10:09 +02:00
Implement IPlugView::onWheel()
This commit is contained in:
@@ -264,6 +264,15 @@ bool Vst3Logger::log_request(bool is_host_vst,
|
||||
});
|
||||
}
|
||||
|
||||
bool Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaPlugView::OnWheel& request) {
|
||||
return log_request_base(is_host_vst, [&](auto& message) {
|
||||
message << request.owner_instance_id
|
||||
<< ": IPlugView::onWheel(distance = " << request.distance
|
||||
<< ")";
|
||||
});
|
||||
}
|
||||
|
||||
bool Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaPlugView::GetSize& request) {
|
||||
return log_request_base(is_host_vst, [&](auto& message) {
|
||||
|
||||
@@ -91,6 +91,7 @@ class Vst3Logger {
|
||||
const YaPlugView::IsPlatformTypeSupported&);
|
||||
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::OnWheel&);
|
||||
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::Terminate&);
|
||||
|
||||
@@ -80,6 +80,7 @@ using ControlRequest = std::variant<Vst3PlugViewProxy::Destruct,
|
||||
YaPlugView::IsPlatformTypeSupported,
|
||||
YaPlugView::Attached,
|
||||
YaPlugView::Removed,
|
||||
YaPlugView::OnWheel,
|
||||
YaPlugView::GetSize,
|
||||
YaPluginBase::Initialize,
|
||||
YaPluginBase::Terminate,
|
||||
|
||||
@@ -129,6 +129,25 @@ class YaPlugView : public Steinberg::IPlugView {
|
||||
};
|
||||
|
||||
virtual tresult PLUGIN_API removed() override = 0;
|
||||
|
||||
/**
|
||||
* Message to pass through a call to `IPlugView::onWheel(distance)` to the
|
||||
* Wine plugin host.
|
||||
*/
|
||||
struct OnWheel {
|
||||
using Response = UniversalTResult;
|
||||
|
||||
native_size_t owner_instance_id;
|
||||
|
||||
float distance;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(owner_instance_id);
|
||||
s.value4b(distance);
|
||||
}
|
||||
};
|
||||
|
||||
virtual tresult PLUGIN_API onWheel(float distance) override = 0;
|
||||
virtual tresult PLUGIN_API onKeyDown(char16 key,
|
||||
int16 keyCode,
|
||||
|
||||
@@ -64,9 +64,8 @@ tresult PLUGIN_API Vst3PlugViewProxyImpl::removed() {
|
||||
}
|
||||
|
||||
tresult PLUGIN_API Vst3PlugViewProxyImpl::onWheel(float distance) {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO: IPlugView::onWheel()");
|
||||
return Steinberg::kNotImplemented;
|
||||
return bridge.send_message(YaPlugView::OnWheel{
|
||||
.owner_instance_id = owner_instance_id(), .distance = distance});
|
||||
}
|
||||
|
||||
tresult PLUGIN_API Vst3PlugViewProxyImpl::onKeyDown(char16 key,
|
||||
|
||||
@@ -370,6 +370,11 @@ void Vst3Bridge::run() {
|
||||
})
|
||||
.get();
|
||||
},
|
||||
[&](const YaPlugView::OnWheel& request)
|
||||
-> YaPlugView::OnWheel::Response {
|
||||
return object_instances[request.owner_instance_id]
|
||||
.plug_view->onWheel(request.distance);
|
||||
},
|
||||
[&](YaPlugView::GetSize& request) -> YaPlugView::GetSize::Response {
|
||||
const tresult result =
|
||||
object_instances[request.owner_instance_id]
|
||||
|
||||
Reference in New Issue
Block a user