diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-17 18:24:23 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2009-12-17 18:24:23 +0000 |
commit | f6fdd8dcbf41f864e9f0cc32dabe81fe3533ddfe (patch) | |
tree | 5214c580b9e6c17a499fa587660dbf949e892bf2 /gtk2_ardour/route_processor_selection.cc | |
parent | da762129f19c28aff64f833b6ec09fba946faef6 (diff) |
switch to using boost::signals2 instead of sigc++, at least for libardour. not finished yet, but compiles, loads sessions, records and can close a session without a crash
git-svn-id: svn://localhost/ardour2/branches/3.0@6372 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/route_processor_selection.cc')
-rw-r--r-- | gtk2_ardour/route_processor_selection.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/gtk2_ardour/route_processor_selection.cc b/gtk2_ardour/route_processor_selection.cc index 1af1e0c968..102cd724dd 100644 --- a/gtk2_ardour/route_processor_selection.cc +++ b/gtk2_ardour/route_processor_selection.cc @@ -26,6 +26,7 @@ #include "ardour/route.h" #include "route_processor_selection.h" +#include "gui_thread.h" #include "i18n.h" @@ -92,18 +93,28 @@ RouteRedirectSelection::add (boost::shared_ptr<Route> r) { if (find (routes.begin(), routes.end(), r) == routes.end()) { routes.push_back (r); + r->GoingAway.connect (boost::bind (&RouteRedirectSelection::removed, this, boost::weak_ptr<Route>(r))); + RoutesChanged(); + } +} - // XXX SHAREDPTR FIXME - // void (RouteRedirectSelection::*pmf)(Route*) = &RouteRedirectSelection::remove; - // r->GoingAway.connect (sigc::bind (sigc::mem_fun(*this, pmf), r)); +void +RouteRedirectSelection::removed (boost::weak_ptr<Route> wr) +{ + boost::shared_ptr<Route> r (wr.lock()); - RoutesChanged(); + if (!r) { + return; } + + remove (r); } void RouteRedirectSelection::remove (boost::shared_ptr<Route> r) { + ENSURE_GUI_THREAD (*this, &RouteRedirectSelection::remove, r); + list<boost::shared_ptr<Route> >::iterator i; if ((i = find (routes.begin(), routes.end(), r)) != routes.end()) { routes.erase (i); |