Prevent identical port-names when renaming tracks

Audio ports are sorted using PBD::naturally_less.
PBD::naturally_less is also used as compare function
for port-lists, port-sets, and port-maps.

So in sets and maps, the function is used to test
for uniqueness. This lead to issues since naturally_less
treats whitespace and underscores as identical.

While it was possible to have routes named "Audio_1",
and "Audio 1", this resulted in missing ports for one
of the routes.

see also 60ff3ef764
This commit is contained in:
Robin Gareus 2021-10-08 04:10:37 +02:00
parent ba2a2cb654
commit 8e5af55ae5
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 2 additions and 3 deletions

View File

@ -4810,9 +4810,8 @@ Route::has_io_processor_named (const string& name)
ProcessorList::iterator i;
for (i = _processors.begin(); i != _processors.end(); ++i) {
if (boost::dynamic_pointer_cast<Send> (*i) ||
boost::dynamic_pointer_cast<PortInsert> (*i)) {
if ((*i)->name() == name) {
if (boost::dynamic_pointer_cast<IOProcessor> (*i)) {
if (0 == PBD::natcmp ((*i)->name().c_str(), name.c_str())) {
return true;
}
}