X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fardour%2Fsession_route.h;h=b7eadac7d203e1a30f0c97d04d3e4ed9cfc530b3;hb=c656aaab3c0c66ea0cde210950af341a3d71c559;hp=0c70bf407d41be3c6f922a5fe7b5e46fb5e01515;hpb=45d3ec1437cf661533bc7750c623865def4424df;p=ardour.git diff --git a/libs/ardour/ardour/session_route.h b/libs/ardour/ardour/session_route.h index 0c70bf407d..b7eadac7d2 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 @@ -22,49 +22,52 @@ #include -#include +#include -#include -#include +#include "ardour/session.h" +#include "ardour/route.h" namespace ARDOUR { -template void -Session::foreach_route (T *obj, void (T::*func)(Route&)) +template void +Session::foreach_route (T *obj, void (T::*func)(Route&), bool sort) { boost::shared_ptr r = routes.reader(); RouteList public_order (*r); - RoutePublicOrderSorter cmp; - public_order.sort (cmp); + if (sort) { + public_order.sort (Stripable::Sorter ()); + } for (RouteList::iterator i = public_order.begin(); i != public_order.end(); i++) { (obj->*func) (**i); } } -template void -Session::foreach_route (T *obj, void (T::*func)(boost::shared_ptr)) +template void +Session::foreach_route (T *obj, void (T::*func)(boost::shared_ptr), bool sort) { boost::shared_ptr r = routes.reader(); RouteList public_order (*r); - RoutePublicOrderSorter cmp; - public_order.sort (cmp); + if (sort) { + public_order.sort (Stripable::Sorter ()); + } for (RouteList::iterator i = public_order.begin(); i != public_order.end(); i++) { (obj->*func) (*i); } } -template void -Session::foreach_route (T *obj, void (T::*func)(Route&, A), A arg1) +template void +Session::foreach_route (T *obj, void (T::*func)(Route&, A), A arg1, bool sort) { boost::shared_ptr r = routes.reader(); RouteList public_order (*r); - RoutePublicOrderSorter cmp; - public_order.sort (cmp); + if (sort) { + public_order.sort (Stripable::Sorter ()); + } for (RouteList::iterator i = public_order.begin(); i != public_order.end(); i++) { (obj->*func) (**i, arg1);