X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Froute_group.cc;h=e1d43f4cd6a72401d2ac8eccddc943cb3b34db2c;hb=2c16f7aa7f7b78e84399d9ed0d8cf99a84d09eb6;hp=d7ac672f9a54f3a8b5bac1da7c21fd17cc8526d4;hpb=61cade6d59118288e90a405e0f4fbc24d0108814;p=ardour.git diff --git a/libs/ardour/route_group.cc b/libs/ardour/route_group.cc index d7ac672f9a..e1d43f4cd6 100644 --- a/libs/ardour/route_group.cc +++ b/libs/ardour/route_group.cc @@ -22,7 +22,6 @@ #include -#include #include "pbd/error.h" #include "pbd/enumwriter.h" @@ -38,7 +37,6 @@ #include "i18n.h" using namespace ARDOUR; -using namespace sigc; using namespace std; RouteGroup::RouteGroup (Session& s, const string &n, Flag f, Property p) @@ -70,15 +68,22 @@ 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 r) { + if (find (routes->begin(), routes->end(), r) != routes->end()) { + return 0; + } + r->leave_route_group (); routes->push_back (r); r->join_route_group (this); - r->GoingAway.connect (sigc::bind (mem_fun (*this, &RouteGroup::remove_when_going_away), boost::weak_ptr (r))); + r->DropReferences.connect_same_thread (*this, boost::bind (&RouteGroup::remove_when_going_away, this, boost::weak_ptr (r))); _session.set_dirty (); changed (); /* EMIT SIGNAL */