mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Implement IPlugView::isPLatformTypeSupported()
This of course requires us to substitute the relevant Linux platform type for the Win32 one.
This commit is contained in:
@@ -432,6 +432,21 @@ bool Vst3Logger::log_request(bool is_host_vst,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Vst3Logger::log_request(
|
||||||
|
bool is_host_vst,
|
||||||
|
const YaPlugView::IsPlatformTypeSupported& request) {
|
||||||
|
return log_request_base(is_host_vst, [&](auto& message) {
|
||||||
|
message << request.owner_instance_id
|
||||||
|
<< ": IPlugView::isPLatformTypeSupported(type = \""
|
||||||
|
<< request.type;
|
||||||
|
if (request.type == Steinberg::kPlatformTypeX11EmbedWindowID) {
|
||||||
|
message << "\" (will be translated to \""
|
||||||
|
<< Steinberg::kPlatformTypeHWND << "\")";
|
||||||
|
}
|
||||||
|
message << ")";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
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) {
|
||||||
|
|||||||
@@ -108,6 +108,8 @@ class Vst3Logger {
|
|||||||
bool log_request(bool is_host_vst,
|
bool log_request(bool is_host_vst,
|
||||||
const YaEditController::SetComponentHandler&);
|
const YaEditController::SetComponentHandler&);
|
||||||
bool log_request(bool is_host_vst, const YaEditController::CreateView&);
|
bool log_request(bool is_host_vst, const YaEditController::CreateView&);
|
||||||
|
bool log_request(bool is_host_vst,
|
||||||
|
const YaPlugView::IsPlatformTypeSupported&);
|
||||||
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&);
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ using ControlRequest = std::variant<Vst3PlugViewProxy::Destruct,
|
|||||||
YaEditController::SetParamNormalized,
|
YaEditController::SetParamNormalized,
|
||||||
YaEditController::SetComponentHandler,
|
YaEditController::SetComponentHandler,
|
||||||
YaEditController::CreateView,
|
YaEditController::CreateView,
|
||||||
|
YaPlugView::IsPlatformTypeSupported,
|
||||||
YaPluginBase::Initialize,
|
YaPluginBase::Initialize,
|
||||||
YaPluginBase::Terminate,
|
YaPluginBase::Terminate,
|
||||||
YaPluginFactory::Construct,
|
YaPluginFactory::Construct,
|
||||||
|
|||||||
@@ -61,6 +61,27 @@ class YaPlugView : public Steinberg::IPlugView {
|
|||||||
|
|
||||||
inline bool supported() const { return arguments.supported; }
|
inline bool supported() const { return arguments.supported; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Message to pass through a call to
|
||||||
|
* `IPlugView::isPlatformTypeSupported(type)` to the Wine plugin host. We
|
||||||
|
* will of course change `kPlatformStringLinux` for `kPlatformStringWin`,
|
||||||
|
* because why would a Windows VST3 plugin have X11 support? (and how would
|
||||||
|
* that even work)
|
||||||
|
*/
|
||||||
|
struct IsPlatformTypeSupported {
|
||||||
|
using Response = UniversalTResult;
|
||||||
|
|
||||||
|
native_size_t owner_instance_id;
|
||||||
|
|
||||||
|
std::string type;
|
||||||
|
|
||||||
|
template <typename S>
|
||||||
|
void serialize(S& s) {
|
||||||
|
s.value8b(owner_instance_id);
|
||||||
|
s.text1b(type, 128);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
virtual tresult PLUGIN_API
|
virtual tresult PLUGIN_API
|
||||||
isPlatformTypeSupported(Steinberg::FIDString type) override = 0;
|
isPlatformTypeSupported(Steinberg::FIDString type) override = 0;
|
||||||
virtual tresult PLUGIN_API attached(void* parent,
|
virtual tresult PLUGIN_API attached(void* parent,
|
||||||
|
|||||||
@@ -42,9 +42,10 @@ Vst3PlugViewProxyImpl::queryInterface(const Steinberg::TUID _iid, void** obj) {
|
|||||||
|
|
||||||
tresult PLUGIN_API
|
tresult PLUGIN_API
|
||||||
Vst3PlugViewProxyImpl::isPlatformTypeSupported(Steinberg::FIDString type) {
|
Vst3PlugViewProxyImpl::isPlatformTypeSupported(Steinberg::FIDString type) {
|
||||||
// TODO: Implement
|
// We'll swap the X11 window ID platform type string for the Win32 HWND
|
||||||
bridge.logger.log("TODO: IPlugView::isPlatformTypeSupported()");
|
// equivalent on the Wine side
|
||||||
return Steinberg::kNotImplemented;
|
return bridge.send_message(YaPlugView::IsPlatformTypeSupported{
|
||||||
|
.owner_instance_id = owner_instance_id(), .type = type});
|
||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API Vst3PlugViewProxyImpl::attached(void* parent,
|
tresult PLUGIN_API Vst3PlugViewProxyImpl::attached(void* parent,
|
||||||
|
|||||||
@@ -398,6 +398,19 @@ void Vst3Bridge::run() {
|
|||||||
request.instance_id)
|
request.instance_id)
|
||||||
: std::nullopt)};
|
: std::nullopt)};
|
||||||
},
|
},
|
||||||
|
[&](const YaPlugView::IsPlatformTypeSupported& request)
|
||||||
|
-> YaPlugView::IsPlatformTypeSupported::Response {
|
||||||
|
// The host will of course want to pass an X11 window ID for the
|
||||||
|
// plugin to embed itself in, so we'll have to translate this to
|
||||||
|
// a HWND
|
||||||
|
const std::string type =
|
||||||
|
request.type == Steinberg::kPlatformTypeX11EmbedWindowID
|
||||||
|
? Steinberg::kPlatformTypeHWND
|
||||||
|
: request.type;
|
||||||
|
|
||||||
|
return object_instances[request.owner_instance_id]
|
||||||
|
.plug_view->isPlatformTypeSupported(type.c_str());
|
||||||
|
},
|
||||||
[&](YaPluginBase::Initialize& request)
|
[&](YaPluginBase::Initialize& request)
|
||||||
-> YaPluginBase::Initialize::Response {
|
-> YaPluginBase::Initialize::Response {
|
||||||
// If we got passed a host context, we'll create a proxy object
|
// If we got passed a host context, we'll create a proxy object
|
||||||
|
|||||||
Reference in New Issue
Block a user