From 962a4becae499dfcba6e17cd3e0198cd2957a16c Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 9 Jul 2024 16:08:16 -0400 Subject: [PATCH] Deal with user specified INSTRUMENT_TYPE (#275) * Deal with user specified INSTRUMENT_TYPE We switch on INSTRUMENT_TYPE to set the internall wrapper handler. We actually only use this in one spot internally but we were failing to make a buildable wrapper if you set the type to something not in our list-of-three. So for now, warn and default out to internal instrument for the other types (which is probably the right behavior for aumf, which is what raised this issue in #271) --- src/detail/auv2/build-helper/build-helper.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/detail/auv2/build-helper/build-helper.cpp b/src/detail/auv2/build-helper/build-helper.cpp index a7267f33..9b99e7db 100644 --- a/src/detail/auv2/build-helper/build-helper.cpp +++ b/src/detail/auv2/build-helper/build-helper.cpp @@ -331,14 +331,21 @@ int main(int argc, char **argv) { cppf << "AUV2_Type::aumu_musicdevice"; } - if (u.type == "aumi") + else if (u.type == "aumi") { cppf << "AUV2_Type::aumi_noteeffect"; } - if (u.type == "aufx") + else if (u.type == "aufx") { cppf << "AUV2_Type::aufx_effect"; } + else + { + std::cout << " + WARNING: Unable to determine AUV2_Type for instrument type '" << u.type + << "'\n" + << " Defaulting to AUV2_Type::musicdevice" << std::endl; + cppf << "AUV2_Type::aumu_musicdevice"; + } cppf << "," << args << ", ci) {}" << "};\n" << "AUSDK_COMPONENT_ENTRY(ausdk::AUMusicDeviceFactory, " << on << ");\n";