mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-09 20:29:10 +02:00
Implement IUnitInfo::getSelectedUnit
This commit is contained in:
@@ -503,6 +503,13 @@ bool Vst3Logger::log_request(bool is_host_vst,
|
||||
});
|
||||
}
|
||||
|
||||
bool Vst3Logger::log_request(bool is_host_vst,
|
||||
const YaUnitInfo::GetSelectedUnit& request) {
|
||||
return log_request_base(is_host_vst, [&](auto& message) {
|
||||
message << request.instance_id << ": IUnitInfo::getSelectedUnit()";
|
||||
});
|
||||
}
|
||||
|
||||
bool Vst3Logger::log_request(
|
||||
bool is_host_vst,
|
||||
const YaAudioProcessor::SetBusArrangements& request) {
|
||||
|
||||
@@ -116,6 +116,7 @@ class Vst3Logger {
|
||||
bool log_request(bool is_host_vst, const YaUnitInfo::GetProgramInfo&);
|
||||
bool log_request(bool is_host_vst, const YaUnitInfo::HasProgramPitchNames&);
|
||||
bool log_request(bool is_host_vst, const YaUnitInfo::GetProgramPitchName&);
|
||||
bool log_request(bool is_host_vst, const YaUnitInfo::GetSelectedUnit&);
|
||||
|
||||
bool log_request(bool is_host_vst,
|
||||
const YaAudioProcessor::SetBusArrangements&);
|
||||
|
||||
@@ -107,7 +107,8 @@ using ControlRequest = std::variant<Vst3PlugViewProxy::Destruct,
|
||||
YaUnitInfo::GetProgramName,
|
||||
YaUnitInfo::GetProgramInfo,
|
||||
YaUnitInfo::HasProgramPitchNames,
|
||||
YaUnitInfo::GetProgramPitchName>;
|
||||
YaUnitInfo::GetProgramPitchName,
|
||||
YaUnitInfo::GetSelectedUnit>;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s, ControlRequest& payload) {
|
||||
|
||||
@@ -324,6 +324,22 @@ class YaUnitInfo : public Steinberg::Vst::IUnitInfo {
|
||||
int32 programIndex,
|
||||
int16 midiPitch,
|
||||
Steinberg::Vst::String128 name /*out*/) override = 0;
|
||||
|
||||
/**
|
||||
* Message to pass through a call to `IUnitInfo::getSelectedUnit()` to the
|
||||
* Wine plugin host.
|
||||
*/
|
||||
struct GetSelectedUnit {
|
||||
using Response = PrimitiveWrapper<Steinberg::Vst::UnitID>;
|
||||
|
||||
native_size_t instance_id;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
}
|
||||
};
|
||||
|
||||
virtual Steinberg::Vst::UnitID PLUGIN_API getSelectedUnit() override = 0;
|
||||
virtual tresult PLUGIN_API
|
||||
selectUnit(Steinberg::Vst::UnitID unitId) override = 0;
|
||||
|
||||
@@ -536,9 +536,8 @@ tresult PLUGIN_API Vst3PluginProxyImpl::getProgramPitchName(
|
||||
}
|
||||
|
||||
Steinberg::Vst::UnitID PLUGIN_API Vst3PluginProxyImpl::getSelectedUnit() {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO: IUnitInfo::getSelectedUnit()");
|
||||
return Steinberg::kNotImplemented;
|
||||
return bridge.send_message(
|
||||
YaUnitInfo::GetSelectedUnit{.instance_id = instance_id()});
|
||||
}
|
||||
|
||||
tresult PLUGIN_API
|
||||
|
||||
@@ -639,6 +639,11 @@ void Vst3Bridge::run() {
|
||||
return YaUnitInfo::GetProgramPitchNameResponse{
|
||||
.result = result, .name = tchar_pointer_to_u16string(name)};
|
||||
},
|
||||
[&](const YaUnitInfo::GetSelectedUnit& request)
|
||||
-> YaUnitInfo::GetSelectedUnit::Response {
|
||||
return object_instances[request.instance_id]
|
||||
.unit_info->getSelectedUnit();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user