mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 12:30:12 +02:00
Implement IComponent::GetBusInfo()
This commit is contained in:
@@ -88,6 +88,15 @@ void Vst3Logger::log_request(bool is_host_vst,
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaComponent::GetBusInfo& request) {
|
||||
log_request_base(is_host_vst, [&](auto& message) {
|
||||
message << "<IComponent* #" << request.instance_id << ">::getBusInfo("
|
||||
<< request.type << ", " << request.dir << ", " << request.index
|
||||
<< ", &bus)";
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaPluginFactory::Construct&) {
|
||||
log_request_base(is_host_vst,
|
||||
@@ -126,6 +135,16 @@ void Vst3Logger::log_response(
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_response(bool is_host_vst,
|
||||
const YaComponent::GetBusInfoResponse& response) {
|
||||
log_response_base(is_host_vst, [&](auto& message) {
|
||||
message << response.result.string();
|
||||
if (response.result.native() == Steinberg::kResultOk) {
|
||||
message << ", <BusInfo>";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void Vst3Logger::log_response(bool is_host_vst,
|
||||
const YaPluginFactory::ConstructArgs& args) {
|
||||
log_response_base(is_host_vst, [&](auto& message) {
|
||||
|
||||
@@ -62,6 +62,7 @@ class Vst3Logger {
|
||||
void log_request(bool is_host_vst, const YaComponent::Terminate&);
|
||||
void log_request(bool is_host_vst, const YaComponent::SetIoMode&);
|
||||
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 YaPluginFactory::Construct&);
|
||||
void log_request(bool is_host_vst, const YaPluginFactory::SetHostContext&);
|
||||
void log_request(bool is_host_vst, const WantsConfiguration&);
|
||||
@@ -70,6 +71,7 @@ class Vst3Logger {
|
||||
void log_response(
|
||||
bool is_host_vst,
|
||||
const std::variant<YaComponent::ConstructArgs, UniversalTResult>&);
|
||||
void log_response(bool is_host_vst, const YaComponent::GetBusInfoResponse&);
|
||||
void log_response(bool is_host_vst, const YaPluginFactory::ConstructArgs&);
|
||||
void log_response(bool is_host_vst, const Configuration&);
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ using ControlRequest = std::variant<YaComponent::Construct,
|
||||
YaComponent::Terminate,
|
||||
YaComponent::SetIoMode,
|
||||
YaComponent::GetBusCount,
|
||||
YaComponent::GetBusInfo,
|
||||
YaPluginFactory::Construct,
|
||||
YaPluginFactory::SetHostContext>;
|
||||
|
||||
|
||||
@@ -216,6 +216,45 @@ class YaComponent : public Steinberg::Vst::IComponent {
|
||||
virtual int32 PLUGIN_API
|
||||
getBusCount(Steinberg::Vst::MediaType type,
|
||||
Steinberg::Vst::BusDirection dir) override = 0;
|
||||
|
||||
/**
|
||||
* The response code and returned bus information for a call to
|
||||
* `IComponent::getBusInfo(type, dir, index, bus <out>)`.
|
||||
*/
|
||||
struct GetBusInfoResponse {
|
||||
UniversalTResult result;
|
||||
Steinberg::Vst::BusInfo updated_bus;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.object(result);
|
||||
s.object(updated_bus);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Message to pass through a call to `IComponent::getBusInfo(type, dir,
|
||||
* index, bus <out>)` to the Wine plugin host.
|
||||
*/
|
||||
struct GetBusInfo {
|
||||
using Response = GetBusInfoResponse;
|
||||
|
||||
native_size_t instance_id;
|
||||
|
||||
Steinberg::Vst::BusType type;
|
||||
Steinberg::Vst::BusDirection dir;
|
||||
int32 index;
|
||||
Steinberg::Vst::BusInfo bus;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
s.value4b(type);
|
||||
s.value4b(dir);
|
||||
s.object(bus);
|
||||
}
|
||||
};
|
||||
|
||||
virtual tresult PLUGIN_API
|
||||
getBusInfo(Steinberg::Vst::MediaType type,
|
||||
Steinberg::Vst::BusDirection dir,
|
||||
@@ -246,3 +285,17 @@ void serialize(
|
||||
std::variant<YaComponent::ConstructArgs, UniversalTResult>& result) {
|
||||
s.ext(result, bitsery::ext::StdVariant{});
|
||||
}
|
||||
|
||||
namespace Steinberg {
|
||||
namespace Vst {
|
||||
template <typename S>
|
||||
void serialize(S& s, Steinberg::Vst::BusInfo& info) {
|
||||
s.value4b(info.mediaType);
|
||||
s.value4b(info.direction);
|
||||
s.value4b(info.channelCount);
|
||||
s.container2b(info.name);
|
||||
s.value4b(info.busType);
|
||||
s.value4b(info.flags);
|
||||
}
|
||||
} // namespace Vst
|
||||
} // namespace Steinberg
|
||||
|
||||
Reference in New Issue
Block a user