Skip to content

Commit

Permalink
Eject the CLAP features as AUv2 tags (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
baconpaul authored Oct 31, 2024
1 parent 0c23f5e commit 705df27
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions src/detail/auv2/build-helper/build-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct auInfo
{
std::string name, vers, type, subt, manu, manunm, clapid, desc, clapname, bundlevers;
bool explicitMode{false};
std::vector<std::string> tags;

const std::string factoryBase{"wrapAsAUV2_inst"};

Expand Down Expand Up @@ -78,8 +79,24 @@ struct auInfo
<< " <true/>\n"
<< " <key>temporary-exception.files.all.read-write</key>\n"
<< " <true/>\n"
<< " </dict>\n"
<< " </dict>\n";
<< " </dict>\n";

if (!tags.empty())
{
of << " <key>tags</key>\n"
<< " <array>\n";
for (auto tag : tags) // purposefully take a copy so we can mutate case
{
if (tag[0] >= 'a' && tag[0] <= 'z')
{
// Upper case the first char
tag[0] = std::toupper(tag[0]);
}
of << " <string>" << tag << "</string>\n";
}
of << " </array>\n";
}
of << " </dict>\n";
}
};

Expand Down Expand Up @@ -154,6 +171,13 @@ bool buildUnitsFromClap(const std::string &clapfile, const std::string &clapname
u.type = "aumu";
}

auto fp = clapPlug->features;
while (*fp)
{
u.tags.push_back(*fp);
++fp;
}

if (loader._pluginFactoryAUv2Info)
{
clap_plugin_info_as_auv2_t v2inf;
Expand Down

0 comments on commit 705df27

Please sign in to comment.