summaryrefslogtreecommitdiff
path: root/libs/ardour/route_group.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-01-15 00:26:47 +0000
committerCarl Hetherington <carl@carlh.net>2010-01-15 00:26:47 +0000
commitbbb65d07d33160366533d9f2390f3f8d56fcb8e1 (patch)
treebb1c8260091653d30a1a2e3984b95aa1a78e88fb /libs/ardour/route_group.cc
parentbd3f48aaa7cd07b830f92af49beef5a4e2b71985 (diff)
Relent a bit and make adding a route to a group which already contains that group a no-op.
git-svn-id: svn://localhost/ardour2/branches/3.0@6490 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/route_group.cc')
-rw-r--r--libs/ardour/route_group.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/libs/ardour/route_group.cc b/libs/ardour/route_group.cc
index f1a3a67a89..e1d43f4cd6 100644
--- a/libs/ardour/route_group.cc
+++ b/libs/ardour/route_group.cc
@@ -68,10 +68,15 @@ RouteGroup::set_name (string str)
FlagsChanged (0); /* EMIT SIGNAL */
}
+/** Add a route to a group. Adding a route which is already in the group is allowed; nothing will happen.
+ * @param r Route to add.
+ */
int
RouteGroup::add (boost::shared_ptr<Route> r)
{
- assert (find (routes->begin(), routes->end(), r) == routes->end ());
+ if (find (routes->begin(), routes->end(), r) != routes->end()) {
+ return 0;
+ }
r->leave_route_group ();