mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 20:10:13 +02:00
Don't serialize input info for IEditController::getParameterInfo
This commit is contained in:
@@ -1417,7 +1417,7 @@ void Vst3Logger::log_response(
|
||||
message << response.result.string();
|
||||
if (response.result == Steinberg::kResultOk) {
|
||||
std::string param_title =
|
||||
VST3::StringConvert::convert(response.updated_info.title);
|
||||
VST3::StringConvert::convert(response.info.title);
|
||||
message << ", <ParameterInfo for '" << param_title << "'>";
|
||||
if (from_cache) {
|
||||
message << " (from cache)";
|
||||
|
||||
@@ -118,12 +118,12 @@ class YaEditController : public Steinberg::Vst::IEditController {
|
||||
*/
|
||||
struct GetParameterInfoResponse {
|
||||
UniversalTResult result;
|
||||
Steinberg::Vst::ParameterInfo updated_info;
|
||||
Steinberg::Vst::ParameterInfo info;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.object(result);
|
||||
s.object(updated_info);
|
||||
s.object(info);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -138,13 +138,11 @@ class YaEditController : public Steinberg::Vst::IEditController {
|
||||
native_size_t instance_id;
|
||||
|
||||
int32 param_index;
|
||||
Steinberg::Vst::ParameterInfo info;
|
||||
|
||||
template <typename S>
|
||||
void serialize(S& s) {
|
||||
s.value8b(instance_id);
|
||||
s.value4b(param_index);
|
||||
s.object(info);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -490,7 +490,7 @@ tresult PLUGIN_API Vst3PluginProxyImpl::getParameterInfo(
|
||||
int32 paramIndex,
|
||||
Steinberg::Vst::ParameterInfo& info /*out*/) {
|
||||
const auto request = YaEditController::GetParameterInfo{
|
||||
.instance_id = instance_id(), .param_index = paramIndex, .info = info};
|
||||
.instance_id = instance_id(), .param_index = paramIndex};
|
||||
|
||||
// We'll cache this information to work around an issue in REAPER, see
|
||||
// `parameter_info_cache`
|
||||
@@ -503,8 +503,7 @@ tresult PLUGIN_API Vst3PluginProxyImpl::getParameterInfo(
|
||||
bridge.logger.log_response(
|
||||
true,
|
||||
YaEditController::GetParameterInfo::Response{
|
||||
.result = Steinberg::kResultOk,
|
||||
.updated_info = it->second},
|
||||
.result = Steinberg::kResultOk, .info = it->second},
|
||||
true);
|
||||
}
|
||||
|
||||
@@ -516,11 +515,11 @@ tresult PLUGIN_API Vst3PluginProxyImpl::getParameterInfo(
|
||||
|
||||
const GetParameterInfoResponse response = bridge.send_message(request);
|
||||
|
||||
info = response.updated_info;
|
||||
info = response.info;
|
||||
|
||||
{
|
||||
std::lock_guard lock(parameter_info_cache_mutex);
|
||||
parameter_info_cache.parameter_info[paramIndex] = response.updated_info;
|
||||
parameter_info_cache.parameter_info[paramIndex] = response.info;
|
||||
}
|
||||
|
||||
return response.result;
|
||||
|
||||
@@ -327,13 +327,13 @@ void Vst3Bridge::run() {
|
||||
},
|
||||
[&](YaEditController::GetParameterInfo& request)
|
||||
-> YaEditController::GetParameterInfo::Response {
|
||||
const tresult result =
|
||||
object_instances[request.instance_id]
|
||||
.edit_controller->getParameterInfo(request.param_index,
|
||||
request.info);
|
||||
Steinberg::Vst::ParameterInfo info{};
|
||||
const tresult result = object_instances[request.instance_id]
|
||||
.edit_controller->getParameterInfo(
|
||||
request.param_index, info);
|
||||
|
||||
return YaEditController::GetParameterInfoResponse{
|
||||
.result = result, .updated_info = std::move(request.info)};
|
||||
.result = result, .info = std::move(info)};
|
||||
},
|
||||
[&](const YaEditController::GetParamStringByValue& request)
|
||||
-> YaEditController::GetParamStringByValue::Response {
|
||||
|
||||
Reference in New Issue
Block a user