mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-16 13:40:05 +02:00
Implement IConnectionPoint::disconnect
This commit is contained in:
@@ -283,6 +283,15 @@ void Vst3Logger::log_request(bool is_host_vst,
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaConnectionPoint::Disconnect& request) {
|
||||
log_request_base(is_host_vst, [&](auto& message) {
|
||||
message << request.instance_id
|
||||
<< ": IConnectionPoint::disconnect(other = <IConnectionPoint* #"
|
||||
<< request.other_instance_id << ">)";
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(
|
||||
bool is_host_vst,
|
||||
const YaEditController2::SetComponentState& request) {
|
||||
|
||||
@@ -80,6 +80,7 @@ class Vst3Logger {
|
||||
void log_request(bool is_host_vst, const YaComponent::ActivateBus&);
|
||||
void log_request(bool is_host_vst, const YaComponent::SetActive&);
|
||||
void log_request(bool is_host_vst, const YaConnectionPoint::Connect&);
|
||||
void log_request(bool is_host_vst, const YaConnectionPoint::Disconnect&);
|
||||
void log_request(bool is_host_vst,
|
||||
const YaEditController2::SetComponentState&);
|
||||
void log_request(bool is_host_vst,
|
||||
|
||||
@@ -76,6 +76,7 @@ using ControlRequest = std::variant<Vst3PluginProxy::Construct,
|
||||
YaComponent::ActivateBus,
|
||||
YaComponent::SetActive,
|
||||
YaConnectionPoint::Connect,
|
||||
YaConnectionPoint::Disconnect,
|
||||
YaEditController2::SetComponentState,
|
||||
YaEditController2::GetParameterCount,
|
||||
YaEditController2::GetParameterInfo,
|
||||
|
||||
@@ -23,7 +23,7 @@ VST3 host interfaces are implemented as follows:
|
||||
| ------------------- | ------------------ |
|
||||
| `YaHostApplication` | `IHostApplication` |
|
||||
|
||||
The following (host) interfaces are also implemented fur serialization purposes:
|
||||
The following (host) interfaces are also implemented for serialization purposes:
|
||||
|
||||
| yabridge class | Interfaces | Notes |
|
||||
| -------------------- | ------------------- | ---------------------------------------------------------------------- |
|
||||
|
||||
@@ -70,6 +70,8 @@ class YaConnectionPoint : public Steinberg::Vst::IConnectionPoint {
|
||||
/**
|
||||
* Message to pass through a call to
|
||||
* `IConnectionPoint::connect(other_instance_id)` to the Wine plugin host.
|
||||
* At the moment this is only implemented for directly connecting objects
|
||||
* created by the plugin without any proxies in between them.
|
||||
*/
|
||||
struct Connect {
|
||||
using Response = UniversalTResult;
|
||||
@@ -91,6 +93,31 @@ class YaConnectionPoint : public Steinberg::Vst::IConnectionPoint {
|
||||
};
|
||||
|
||||
virtual tresult PLUGIN_API connect(IConnectionPoint* other) override = 0;
|
||||
|
||||
/**
|
||||
* Message to pass through a call to
|
||||
* `IConnectionPoint::disconnect(other_instance_id)` to the Wine plugin
|
||||
* host. At the moment this is only implemented for directly connecting
|
||||
* objects created by the plugin without any proxies in between them.
|
||||
*/
|
||||
struct Disconnect {
|
||||
using Response = UniversalTResult;
|
||||
|
||||
native_size_t instance_id;
|
||||
|
||||
/**
|
||||
* The other object backed by a `Vst3PluginProxy` this object was
|
||||
* connected to and should be disconnected from. When connecting.
|
||||
*/
|
||||
native_size_t other_instance_id;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
s.value8b(other_instance_id);
|
||||
}
|
||||
};
|
||||
|
||||
virtual tresult PLUGIN_API disconnect(IConnectionPoint* other) override = 0;
|
||||
virtual tresult PLUGIN_API
|
||||
notify(Steinberg::Vst::IMessage* message) override = 0;
|
||||
|
||||
@@ -207,9 +207,19 @@ tresult PLUGIN_API Vst3PluginProxyImpl::connect(IConnectionPoint* other) {
|
||||
}
|
||||
|
||||
tresult PLUGIN_API Vst3PluginProxyImpl::disconnect(IConnectionPoint* other) {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO IConnectionPoint::disconnect()");
|
||||
return Steinberg::kNotImplemented;
|
||||
// See `Vst3PluginProxyImpl::connect()`
|
||||
if (auto other_proxy = dynamic_cast<Vst3PluginProxy*>(other)) {
|
||||
return bridge.send_message(YaConnectionPoint::Disconnect{
|
||||
.instance_id = instance_id(),
|
||||
.other_instance_id = other_proxy->instance_id()});
|
||||
} else {
|
||||
// TODO: Add support for `ConnectionProxy` and similar objects
|
||||
bridge.logger.log(
|
||||
"WARNING: The host passed a proxy proxy object to "
|
||||
"'IConnectionPoint::disconnect()'. This is currently not "
|
||||
"supported.");
|
||||
return Steinberg::kNotImplemented;
|
||||
}
|
||||
}
|
||||
|
||||
tresult PLUGIN_API
|
||||
|
||||
@@ -261,6 +261,15 @@ void Vst3Bridge::run() {
|
||||
object_instances[request.other_instance_id]
|
||||
.connection_point);
|
||||
},
|
||||
[&](const YaConnectionPoint::Disconnect& request)
|
||||
-> YaConnectionPoint::Disconnect::Response {
|
||||
// TODO: Add support for connecting objects through a proxy
|
||||
// object provided by the host
|
||||
return object_instances[request.instance_id]
|
||||
.connection_point->disconnect(
|
||||
object_instances[request.other_instance_id]
|
||||
.connection_point);
|
||||
},
|
||||
[&](YaEditController2::SetComponentState& request)
|
||||
-> YaEditController2::SetComponentState::Response {
|
||||
return object_instances[request.instance_id]
|
||||
|
||||
Reference in New Issue
Block a user