mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-08 04:20:13 +02:00
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:
@@ -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 << "\"";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ class Vst3Logger {
|
||||
bool log_request(bool is_host_vst, const YaComponentHandler::EndEdit&);
|
||||
bool log_request(bool is_host_vst,
|
||||
const YaComponentHandler::RestartComponent&);
|
||||
bool log_request(bool is_host_vst, const YaHostApplication::GetName&);
|
||||
|
||||
void log_response(bool is_host_vst, const Ack&);
|
||||
void log_response(
|
||||
@@ -138,6 +139,9 @@ class Vst3Logger {
|
||||
void log_response(bool is_host_vst, const YaPluginFactory::ConstructArgs&);
|
||||
void log_response(bool is_host_vst, const Configuration&);
|
||||
|
||||
void log_response(bool is_host_vst,
|
||||
const YaHostApplication::GetNameResponse&);
|
||||
|
||||
template <typename T>
|
||||
void log_response(bool is_host_vst, const PrimitiveWrapper<T>& value) {
|
||||
// For logging all primitive return values other than `tresult`
|
||||
|
||||
Reference in New Issue
Block a user