diff options
author | Robin Gareus <robin@gareus.org> | 2020-03-02 17:43:10 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-03-02 20:07:52 +0100 |
commit | 6e0062d5498f90c52d6aeb87e63bc846d2922020 (patch) | |
tree | 8ad1c0227e87123cb022f6931b7ff927afb235d5 /libs/ardour/send.cc | |
parent | 711f20a469e31ba8fe8d1474969855825dab834c (diff) |
Refactor send naming (#7905)
This allows users to rename sends without enforcing a numeric
bitslot number. However this prevents a user to to use "send" names
that are potentially used for new sends or inserts.
Diffstat (limited to 'libs/ardour/send.cc')
-rw-r--r-- | libs/ardour/send.cc | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/libs/ardour/send.cc b/libs/ardour/send.cc index 3f1750be22..7202924906 100644 --- a/libs/ardour/send.cc +++ b/libs/ardour/send.cc @@ -485,22 +485,11 @@ Send::set_name (const string& new_name) string unique_name; if (_role == Delivery::Send) { - char buf[32]; + unique_name = validate_name (new_name, string_compose (_("send %1"), _bitslot)); - /* rip any existing numeric part of the name, and append the bitslot - */ - - string::size_type last_letter = new_name.find_last_not_of ("0123456789"); - - if (last_letter != string::npos) { - unique_name = new_name.substr (0, last_letter + 1); - } else { - unique_name = new_name; + if (unique_name.empty ()) { + return false; } - - snprintf (buf, sizeof (buf), "%u", (_bitslot + 1)); - unique_name += buf; - } else { unique_name = new_name; } |