mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 12:10:09 +02:00
Implement IUnitInfo::getProgramListCount
This commit is contained in:
@@ -446,6 +446,13 @@ bool Vst3Logger::log_request(bool is_host_vst,
|
||||
});
|
||||
}
|
||||
|
||||
bool Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaUnitInfo::GetProgramListCount& request) {
|
||||
return log_request_base(is_host_vst, [&](auto& message) {
|
||||
message << request.instance_id << ": IUnitInfo::getProgramListCount()";
|
||||
});
|
||||
}
|
||||
|
||||
bool Vst3Logger::log_request(
|
||||
bool is_host_vst,
|
||||
const YaAudioProcessor::SetBusArrangements& request) {
|
||||
|
||||
@@ -110,6 +110,7 @@ class Vst3Logger {
|
||||
bool log_request(bool is_host_vst, const YaPluginFactory::SetHostContext&);
|
||||
bool log_request(bool is_host_vst, const YaUnitInfo::GetUnitCount&);
|
||||
bool log_request(bool is_host_vst, const YaUnitInfo::GetUnitInfo&);
|
||||
bool log_request(bool is_host_vst, const YaUnitInfo::GetProgramListCount&);
|
||||
|
||||
bool log_request(bool is_host_vst,
|
||||
const YaAudioProcessor::SetBusArrangements&);
|
||||
|
||||
@@ -101,7 +101,8 @@ using ControlRequest = std::variant<Vst3PlugViewProxy::Destruct,
|
||||
YaPluginFactory::Construct,
|
||||
YaPluginFactory::SetHostContext,
|
||||
YaUnitInfo::GetUnitCount,
|
||||
YaUnitInfo::GetUnitInfo>;
|
||||
YaUnitInfo::GetUnitInfo,
|
||||
YaUnitInfo::GetProgramListCount>;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s, ControlRequest& payload) {
|
||||
|
||||
@@ -115,6 +115,22 @@ class YaUnitInfo : public Steinberg::Vst::IUnitInfo {
|
||||
virtual tresult PLUGIN_API
|
||||
getUnitInfo(int32 unitIndex,
|
||||
Steinberg::Vst::UnitInfo& info /*out*/) override = 0;
|
||||
|
||||
/**
|
||||
* Message to pass through a call to `IUnitInfo::getProgramListCount()` to
|
||||
* the Wine plugin host.
|
||||
*/
|
||||
struct GetProgramListCount {
|
||||
using Response = PrimitiveWrapper<int32>;
|
||||
|
||||
native_size_t instance_id;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
}
|
||||
};
|
||||
|
||||
virtual int32 PLUGIN_API getProgramListCount() override = 0;
|
||||
virtual tresult PLUGIN_API getProgramListInfo(
|
||||
int32 listIndex,
|
||||
|
||||
@@ -458,9 +458,8 @@ Vst3PluginProxyImpl::getUnitInfo(int32 unitIndex,
|
||||
}
|
||||
|
||||
int32 PLUGIN_API Vst3PluginProxyImpl::getProgramListCount() {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO: IUnitInfo::getProgramListCount()");
|
||||
return Steinberg::kNotImplemented;
|
||||
return bridge.send_message(
|
||||
YaUnitInfo::GetProgramListCount{.instance_id = instance_id()});
|
||||
}
|
||||
|
||||
tresult PLUGIN_API Vst3PluginProxyImpl::getProgramListInfo(
|
||||
|
||||
@@ -581,6 +581,11 @@ void Vst3Bridge::run() {
|
||||
return YaUnitInfo::GetUnitInfoResponse{.result = result,
|
||||
.info = info};
|
||||
},
|
||||
[&](const YaUnitInfo::GetProgramListCount& request)
|
||||
-> YaUnitInfo::GetProgramListCount::Response {
|
||||
return object_instances[request.instance_id]
|
||||
.unit_info->getProgramListCount();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user