summaryrefslogtreecommitdiff
path: root/libs/ardour/port_insert.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-03-02 17:43:10 +0100
committerRobin Gareus <robin@gareus.org>2020-03-02 20:07:52 +0100
commit6e0062d5498f90c52d6aeb87e63bc846d2922020 (patch)
tree8ad1c0227e87123cb022f6931b7ff927afb235d5 /libs/ardour/port_insert.cc
parent711f20a469e31ba8fe8d1474969855825dab834c (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/port_insert.cc')
-rw-r--r--libs/ardour/port_insert.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/libs/ardour/port_insert.cc b/libs/ardour/port_insert.cc
index 49fe4ad385..46f9f686ab 100644
--- a/libs/ardour/port_insert.cc
+++ b/libs/ardour/port_insert.cc
@@ -42,7 +42,7 @@ string
PortInsert::name_and_id_new_insert (Session& s, uint32_t& bitslot)
{
bitslot = s.next_insert_id ();
- return string_compose (_("insert %1"), bitslot+ 1);
+ return string_compose (_("insert %1"), bitslot);
}
PortInsert::PortInsert (Session& s, boost::shared_ptr<Pannable> pannable, boost::shared_ptr<MuteMaster> mm)
@@ -272,13 +272,15 @@ PortInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out)
}
bool
-PortInsert::set_name (const std::string& name)
+PortInsert::set_name (const std::string& new_name)
{
- bool ret = Processor::set_name (name);
+ string unique_name = validate_name (new_name, string_compose (_("insert %1"), _bitslot));
- ret = (ret && _input->set_name (name) && _output->set_name (name));
+ if (unique_name.empty ()) {
+ return false;
+ }
- return ret;
+ return IOProcessor::set_name (unique_name);
}
void