mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
Implement IComponent::activateBus()
This commit is contained in:
@@ -114,6 +114,16 @@ void Vst3Logger::log_request(bool is_host_vst,
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaComponent::ActivateBus& request) {
|
||||
log_request_base(is_host_vst, [&](auto& message) {
|
||||
message << "<IComponent* #" << request.instance_id
|
||||
<< ">::activateBus(type = " << request.type
|
||||
<< ", dir = " << request.dir << ", index = " << request.index
|
||||
<< ", state = " << (request.state ? "true" : "false") << ">)";
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaPluginFactory::Construct&) {
|
||||
log_request_base(is_host_vst,
|
||||
|
||||
@@ -64,6 +64,7 @@ class Vst3Logger {
|
||||
void log_request(bool is_host_vst, const YaComponent::GetBusCount&);
|
||||
void log_request(bool is_host_vst, const YaComponent::GetBusInfo&);
|
||||
void log_request(bool is_host_vst, const YaComponent::GetRoutingInfo&);
|
||||
void log_request(bool is_host_vst, const YaComponent::ActivateBus&);
|
||||
void log_request(bool is_host_vst, const YaPluginFactory::Construct&);
|
||||
void log_request(bool is_host_vst, const YaPluginFactory::SetHostContext&);
|
||||
void log_request(bool is_host_vst, const WantsConfiguration&);
|
||||
|
||||
@@ -65,6 +65,7 @@ using ControlRequest = std::variant<YaComponent::Construct,
|
||||
YaComponent::GetBusCount,
|
||||
YaComponent::GetBusInfo,
|
||||
YaComponent::GetRoutingInfo,
|
||||
YaComponent::ActivateBus,
|
||||
YaPluginFactory::Construct,
|
||||
YaPluginFactory::SetHostContext>;
|
||||
|
||||
|
||||
@@ -301,6 +301,31 @@ class YaComponent : public Steinberg::Vst::IComponent {
|
||||
virtual tresult PLUGIN_API
|
||||
getRoutingInfo(Steinberg::Vst::RoutingInfo& inInfo,
|
||||
Steinberg::Vst::RoutingInfo& outInfo /*out*/) override = 0;
|
||||
|
||||
/**
|
||||
* Message to pass through a call to `IComponent::activateBus(type, dir,
|
||||
* index, state)` to the Wine plugin host.
|
||||
*/
|
||||
struct ActivateBus {
|
||||
using Response = UniversalTResult;
|
||||
|
||||
native_size_t instance_id;
|
||||
|
||||
Steinberg::Vst::MediaType type;
|
||||
Steinberg::Vst::BusDirection dir;
|
||||
int32 index;
|
||||
TBool state;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
s.value4b(type);
|
||||
s.value4b(dir);
|
||||
s.value4b(index);
|
||||
s.value1b(state);
|
||||
}
|
||||
};
|
||||
|
||||
virtual tresult PLUGIN_API activateBus(Steinberg::Vst::MediaType type,
|
||||
Steinberg::Vst::BusDirection dir,
|
||||
int32 index,
|
||||
|
||||
@@ -123,9 +123,14 @@ YaComponentPluginImpl::activateBus(Steinberg::Vst::MediaType type,
|
||||
Steinberg::Vst::BusDirection dir,
|
||||
int32 index,
|
||||
TBool state) {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO: IComponent::activateBus()");
|
||||
return Steinberg::kNotImplemented;
|
||||
return bridge
|
||||
.send_message(
|
||||
YaComponent::ActivateBus{.instance_id = arguments.instance_id,
|
||||
.type = type,
|
||||
.dir = dir,
|
||||
.index = index,
|
||||
.state = state})
|
||||
.native();
|
||||
}
|
||||
|
||||
tresult PLUGIN_API YaComponentPluginImpl::setActive(TBool state) {
|
||||
|
||||
@@ -142,6 +142,12 @@ void Vst3Bridge::run() {
|
||||
.updated_in_info = request.in_info,
|
||||
.updated_out_info = request.out_info};
|
||||
},
|
||||
[&](const YaComponent::ActivateBus& request)
|
||||
-> YaComponent::ActivateBus::Response {
|
||||
return component_instances[request.instance_id]
|
||||
.component->activateBus(request.type, request.dir,
|
||||
request.index, request.state);
|
||||
},
|
||||
[&](const YaPluginFactory::Construct&)
|
||||
-> YaPluginFactory::Construct::Response {
|
||||
return YaPluginFactory::ConstructArgs(
|
||||
|
||||
Reference in New Issue
Block a user