mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +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 Vst3Logger::log_request(
|
||||||
bool is_host_vst,
|
bool is_host_vst,
|
||||||
const YaAudioProcessor::SetBusArrangements& request) {
|
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 YaPluginFactory::SetHostContext&);
|
||||||
bool log_request(bool is_host_vst, const YaUnitInfo::GetUnitCount&);
|
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::GetUnitInfo&);
|
||||||
|
bool log_request(bool is_host_vst, const YaUnitInfo::GetProgramListCount&);
|
||||||
|
|
||||||
bool log_request(bool is_host_vst,
|
bool log_request(bool is_host_vst,
|
||||||
const YaAudioProcessor::SetBusArrangements&);
|
const YaAudioProcessor::SetBusArrangements&);
|
||||||
|
|||||||
@@ -101,7 +101,8 @@ using ControlRequest = std::variant<Vst3PlugViewProxy::Destruct,
|
|||||||
YaPluginFactory::Construct,
|
YaPluginFactory::Construct,
|
||||||
YaPluginFactory::SetHostContext,
|
YaPluginFactory::SetHostContext,
|
||||||
YaUnitInfo::GetUnitCount,
|
YaUnitInfo::GetUnitCount,
|
||||||
YaUnitInfo::GetUnitInfo>;
|
YaUnitInfo::GetUnitInfo,
|
||||||
|
YaUnitInfo::GetProgramListCount>;
|
||||||
|
|
||||||
template <typename S>
|
template <typename S>
|
||||||
void serialize(S& s, ControlRequest& payload) {
|
void serialize(S& s, ControlRequest& payload) {
|
||||||
|
|||||||
@@ -115,6 +115,22 @@ class YaUnitInfo : public Steinberg::Vst::IUnitInfo {
|
|||||||
virtual tresult PLUGIN_API
|
virtual tresult PLUGIN_API
|
||||||
getUnitInfo(int32 unitIndex,
|
getUnitInfo(int32 unitIndex,
|
||||||
Steinberg::Vst::UnitInfo& info /*out*/) override = 0;
|
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 int32 PLUGIN_API getProgramListCount() override = 0;
|
||||||
virtual tresult PLUGIN_API getProgramListInfo(
|
virtual tresult PLUGIN_API getProgramListInfo(
|
||||||
int32 listIndex,
|
int32 listIndex,
|
||||||
|
|||||||
@@ -458,9 +458,8 @@ Vst3PluginProxyImpl::getUnitInfo(int32 unitIndex,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32 PLUGIN_API Vst3PluginProxyImpl::getProgramListCount() {
|
int32 PLUGIN_API Vst3PluginProxyImpl::getProgramListCount() {
|
||||||
// TODO: Implement
|
return bridge.send_message(
|
||||||
bridge.logger.log("TODO: IUnitInfo::getProgramListCount()");
|
YaUnitInfo::GetProgramListCount{.instance_id = instance_id()});
|
||||||
return Steinberg::kNotImplemented;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tresult PLUGIN_API Vst3PluginProxyImpl::getProgramListInfo(
|
tresult PLUGIN_API Vst3PluginProxyImpl::getProgramListInfo(
|
||||||
|
|||||||
@@ -581,6 +581,11 @@ void Vst3Bridge::run() {
|
|||||||
return YaUnitInfo::GetUnitInfoResponse{.result = result,
|
return YaUnitInfo::GetUnitInfoResponse{.result = result,
|
||||||
.info = info};
|
.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