Implement IPlugView::attached()

This commit is contained in:
Robbert van der Helm
2020-12-19 23:31:41 +01:00
parent 49fc896d62
commit 09f6d93214
7 changed files with 90 additions and 4 deletions
+14
View File
@@ -447,6 +447,20 @@ bool Vst3Logger::log_request(
});
}
bool Vst3Logger::log_request(bool is_host_vst,
const YaPlugView::Attached& request) {
return log_request_base(is_host_vst, [&](auto& message) {
message << request.owner_instance_id
<< ": IPlugView::attached(parent = " << request.parent
<< ", type = \"" << request.type;
if (request.type == Steinberg::kPlatformTypeX11EmbedWindowID) {
message << "\" (will be translated to \""
<< Steinberg::kPlatformTypeHWND << "\")";
}
message << ")";
});
}
bool Vst3Logger::log_request(bool is_host_vst,
const YaPluginBase::Initialize& request) {
return log_request_base(is_host_vst, [&](auto& message) {
+1
View File
@@ -110,6 +110,7 @@ class Vst3Logger {
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 YaPlugView::Attached&);
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
@@ -93,6 +93,7 @@ using ControlRequest = std::variant<Vst3PlugViewProxy::Destruct,
YaEditController::SetComponentHandler,
YaEditController::CreateView,
YaPlugView::IsPlatformTypeSupported,
YaPlugView::Attached,
YaPluginBase::Initialize,
YaPluginBase::Terminate,
YaPluginFactory::Construct,
@@ -84,6 +84,32 @@ class YaPlugView : public Steinberg::IPlugView {
virtual tresult PLUGIN_API
isPlatformTypeSupported(Steinberg::FIDString type) override = 0;
/**
* Message to pass through a call to `IPlugView::attached(parent, type)` to
* the Wine plugin host. Like mentioned above we will substitute
* `kPlatformStringWin` for `kPlatformStringLinux`.
*/
struct Attached {
using Response = UniversalTResult;
native_size_t owner_instance_id;
/**
* The parent handle passed by the host. This will be an
* `xcb_window_id`, and we'll embed the Wine window into it ourselves.
*/
native_size_t parent;
std::string type;
template <typename S>
void serialize(S& s) {
s.value8b(owner_instance_id);
s.value8b(parent);
s.text1b(type, 128);
}
};
virtual tresult PLUGIN_API attached(void* parent,
Steinberg::FIDString type) override = 0;
virtual tresult PLUGIN_API removed() override = 0;