mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 03:50:11 +02:00
Implement all IUnitInfo functions
With this IUnitInfo has been fully implemented.
This commit is contained in:
@@ -108,7 +108,10 @@ using ControlRequest = std::variant<Vst3PlugViewProxy::Destruct,
|
||||
YaUnitInfo::GetProgramInfo,
|
||||
YaUnitInfo::HasProgramPitchNames,
|
||||
YaUnitInfo::GetProgramPitchName,
|
||||
YaUnitInfo::GetSelectedUnit>;
|
||||
YaUnitInfo::GetSelectedUnit,
|
||||
YaUnitInfo::SelectUnit,
|
||||
YaUnitInfo::GetUnitByBus,
|
||||
YaUnitInfo::SetUnitProgramData>;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s, ControlRequest& payload) {
|
||||
|
||||
@@ -542,9 +542,8 @@ Steinberg::Vst::UnitID PLUGIN_API Vst3PluginProxyImpl::getSelectedUnit() {
|
||||
|
||||
tresult PLUGIN_API
|
||||
Vst3PluginProxyImpl::selectUnit(Steinberg::Vst::UnitID unitId) {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO: IUnitInfo::selectUnit()");
|
||||
return Steinberg::kNotImplemented;
|
||||
return bridge.send_message(YaUnitInfo::SelectUnit{
|
||||
.instance_id = instance_id(), .unit_id = unitId});
|
||||
}
|
||||
|
||||
tresult PLUGIN_API
|
||||
@@ -553,16 +552,25 @@ Vst3PluginProxyImpl::getUnitByBus(Steinberg::Vst::MediaType type,
|
||||
int32 busIndex,
|
||||
int32 channel,
|
||||
Steinberg::Vst::UnitID& unitId /*out*/) {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO: IUnitInfo::getUnitByBus()");
|
||||
return Steinberg::kNotImplemented;
|
||||
const GetUnitByBusResponse response = bridge.send_message(
|
||||
YaUnitInfo::GetUnitByBus{.instance_id = instance_id(),
|
||||
.type = type,
|
||||
.dir = dir,
|
||||
.bus_index = busIndex,
|
||||
.channel = channel});
|
||||
|
||||
unitId = response.unit_id;
|
||||
|
||||
return response.result;
|
||||
}
|
||||
|
||||
tresult PLUGIN_API
|
||||
Vst3PluginProxyImpl::setUnitProgramData(int32 listOrUnitId,
|
||||
int32 programIndex,
|
||||
Steinberg::IBStream* data) {
|
||||
// TODO: Implement
|
||||
bridge.logger.log("TODO: IUnitInfo::setUnitProgramData()");
|
||||
return Steinberg::kNotImplemented;
|
||||
return bridge.send_message(
|
||||
YaUnitInfo::SetUnitProgramData{.instance_id = instance_id(),
|
||||
.list_or_unit_id = listOrUnitId,
|
||||
.program_index = programIndex,
|
||||
.data = data});
|
||||
}
|
||||
|
||||
@@ -644,6 +644,30 @@ void Vst3Bridge::run() {
|
||||
return object_instances[request.instance_id]
|
||||
.unit_info->getSelectedUnit();
|
||||
},
|
||||
[&](const YaUnitInfo::SelectUnit& request)
|
||||
-> YaUnitInfo::SelectUnit::Response {
|
||||
return object_instances[request.instance_id]
|
||||
.unit_info->selectUnit(request.unit_id);
|
||||
},
|
||||
[&](const YaUnitInfo::GetUnitByBus& request)
|
||||
-> YaUnitInfo::GetUnitByBus::Response {
|
||||
Steinberg::Vst::UnitID unit_id;
|
||||
const tresult result =
|
||||
object_instances[request.instance_id]
|
||||
.unit_info->getUnitByBus(request.type, request.dir,
|
||||
request.bus_index,
|
||||
request.channel, unit_id);
|
||||
|
||||
return YaUnitInfo::GetUnitByBusResponse{.result = result,
|
||||
.unit_id = unit_id};
|
||||
},
|
||||
[&](YaUnitInfo::SetUnitProgramData& request)
|
||||
-> YaUnitInfo::SetUnitProgramData::Response {
|
||||
return object_instances[request.instance_id]
|
||||
.unit_info->setUnitProgramData(request.list_or_unit_id,
|
||||
request.program_index,
|
||||
&request.data);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user