Use the univeral tresult in IComponent creation

This commit is contained in:
Robbert van der Helm
2020-12-11 23:54:30 +01:00
parent 91a47a466c
commit e24cecc6d7
7 changed files with 49 additions and 28 deletions
+11 -6
View File
@@ -56,13 +56,18 @@ void Vst3Logger::log_response(bool is_host_vst, const Ack&) {
void Vst3Logger::log_response(
bool is_host_vst,
const std::optional<YaComponent::CreateArgs>& args) {
const std::variant<YaComponent::CreateArgs, UniversalTResult>& result) {
log_response_base(is_host_vst, [&](auto& message) {
if (args) {
message << "<IComponent* #" << args->instance_id << ">";
} else {
message << "<nullptr>";
}
std::visit(overload{[&](const YaComponent::CreateArgs& args) {
message << "<IComponent* #" << args.instance_id
<< ">";
},
[&](const UniversalTResult& code) {
// TODO: Add a `UniversalTResult::string()` for
// the human readable representation
message << code.native();
}},
result);
});
}