Disallow click and auditioner as track / buss names to avoid clashing with internal IOs.

git-svn-id: svn://localhost/ardour2/branches/3.0@5009 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2009-04-29 16:15:33 +00:00
parent b28bc3b43e
commit 7eba373a0f
3 changed files with 21 additions and 3 deletions

View File

@ -1346,11 +1346,14 @@ RouteTimeAxisView::name_entry_changed ()
return;
}
if (_session.route_name_unique (x)) {
_route->set_name (x);
} else {
if (!_session.route_name_unique (x)) {
ARDOUR_UI::instance()->popup_error (_("A track already exists with that name"));
name_entry.set_text (_route->name());
} else if (_session.route_name_internal (x)) {
ARDOUR_UI::instance()->popup_error (_("You cannot create a track with that name as it is reserved for Ardour"));
name_entry.set_text (_route->name());
} else {
_route->set_name (x);
}
}

View File

@ -332,6 +332,7 @@ class Session : public PBD::StatefulDestructible, public boost::noncopyable
boost::shared_ptr<Route> route_by_remote_id (uint32_t id);
bool route_name_unique (string) const;
bool route_name_internal (string) const;
bool get_record_enabled() const {
return (record_status () >= Enabled);

View File

@ -4002,6 +4002,20 @@ Session::route_name_unique (string n) const
return true;
}
bool
Session::route_name_internal (string n) const
{
if (auditioner && auditioner->name() == n) {
return true;
}
if (_click_io && _click_io->name() == n) {
return true;
}
return false;
}
uint32_t
Session::n_playlists () const
{