X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fsession_route.h;h=cfaa13cdc8c354f182e224c2fd17b0524e84f407;hb=ba0458cf1f6c69366e89631d8fff916ad183d768;hp=afe78b394e39efcafba0cf1b0893a1d7c2431c18;hpb=9fdc36bac5fa1c004751c0dd42f9ff62b9d60814;p=ardour.git diff --git a/libs/ardour/ardour/session_route.h b/libs/ardour/ardour/session_route.h index afe78b394e..cfaa13cdc8 100644 --- a/libs/ardour/ardour/session_route.h +++ b/libs/ardour/ardour/session_route.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2000 Paul Davis + Copyright (C) 2000 Paul Davis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #ifndef __ardour_session_route_h__ @@ -25,22 +24,18 @@ #include -#include -#include +#include "ardour/session.h" +#include "ardour/route.h" namespace ARDOUR { -template void +template void Session::foreach_route (T *obj, void (T::*func)(Route&)) { - RouteList public_order; - - { - Glib::RWLock::ReaderLock lm (route_lock); - public_order = routes; - } - + boost::shared_ptr r = routes.reader(); + RouteList public_order (*r); RoutePublicOrderSorter cmp; + public_order.sort (cmp); for (RouteList::iterator i = public_order.begin(); i != public_order.end(); i++) { @@ -48,17 +43,13 @@ Session::foreach_route (T *obj, void (T::*func)(Route&)) } } -template void -Session::foreach_route (T *obj, void (T::*func)(Route*)) +template void +Session::foreach_route (T *obj, void (T::*func)(boost::shared_ptr)) { - RouteList public_order; - - { - Glib::RWLock::ReaderLock lm (route_lock); - public_order = routes; - } - + boost::shared_ptr r = routes.reader(); + RouteList public_order (*r); RoutePublicOrderSorter cmp; + public_order.sort (cmp); for (RouteList::iterator i = public_order.begin(); i != public_order.end(); i++) { @@ -66,18 +57,13 @@ Session::foreach_route (T *obj, void (T::*func)(Route*)) } } - -template void +template void Session::foreach_route (T *obj, void (T::*func)(Route&, A), A arg1) { - RouteList public_order; - - { - Glib::RWLock::ReaderLock lm (route_lock); - public_order = routes; - } - + boost::shared_ptr r = routes.reader(); + RouteList public_order (*r); RoutePublicOrderSorter cmp; + public_order.sort (cmp); for (RouteList::iterator i = public_order.begin(); i != public_order.end(); i++) {