Don't cache IHostApplication::getName()

As it turns out there are only two or three functions where we can do
this. It also breaks logging, and this function will probably only be
called once anyways. More consistency is always better.
This commit is contained in:
Robbert van der Helm
2020-12-19 18:28:16 +01:00
parent 01d84b0029
commit 63ae5f330c
13 changed files with 124 additions and 41 deletions
+25
View File
@@ -487,6 +487,19 @@ bool Vst3Logger::log_request(
});
}
bool Vst3Logger::log_request(bool is_host_vst,
const YaHostApplication::GetName& request) {
return log_request_base(is_host_vst, [&](auto& message) {
// This can be called either from a plugin object or from the plugin's
// plugin factory
if (request.owner_instance_id) {
message << *request.owner_instance_id << ": ";
}
message << "IHostApplication::getName(&name)";
});
}
void Vst3Logger::log_response(bool is_host_vst, const Ack&) {
log_response_base(is_host_vst, [&](auto& message) { message << "ACK"; });
}
@@ -644,3 +657,15 @@ void Vst3Logger::log_response(bool is_host_vst, const Configuration&) {
log_response_base(is_host_vst,
[&](auto& message) { message << "<Configuration>"; });
}
void Vst3Logger::log_response(
bool is_host_vst,
const YaHostApplication::GetNameResponse& response) {
log_response_base(is_host_vst, [&](auto& message) {
message << response.result.string();
if (response.result == Steinberg::kResultOk) {
std::string value = VST3::StringConvert::convert(response.name);
message << ", \"" << value << "\"";
}
});
}