#ifdef BOOST_SP_ENABLE_DEBUG_HOOKS
// boost_debug_shared_ptr_mark_interesting (r.get(), "Route");
#endif
- {
+ try {
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
r->input()->ensure_io (_master_out->output()->n_ports(), false, this);
r->output()->ensure_io (_master_out->output()->n_ports(), false, this);
+ } catch (...) {
+ error << _("Cannot create monitor section. 'Monitor' Port name is not unique.") << endmsg;
+ return;
}
rl.push_back (r);
bool
Session::find_route_name (string const & base, uint32_t& id, string& name, bool definitely_add_number)
{
+ /* it is unfortunate that we need to include reserved names here that
+ refer to control surfaces. But there's no way to ensure a complete
+ lack of collisions without doing this, since the control surface
+ support may not even be active. Without adding an API to control
+ surface support that would list their port names, we do have to
+ list them here.
+ */
+
+ char const * const reserved[] = {
+ _("Monitor"),
+ _("Master"),
+ _("Control"),
+ _("Click"),
+ _("Mackie"),
+ 0
+ };
+
+ /* the base may conflict with ports that do not belong to existing
+ routes, but hidden objects like the click track. So check port names
+ before anything else.
+ */
+
+ for (int n = 0; reserved[n]; ++n) {
+ if (base == reserved[n]) {
+ definitely_add_number = true;
+ if (id < 1) {
+ id = 1;
+ }
+ break;
+ }
+ }
+
if (!definitely_add_number && route_by_name (base) == 0) {
/* juse use the base */
name = base;