summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/session_route.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/ardour/session_route.h')
-rw-r--r--libs/ardour/ardour/session_route.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/libs/ardour/ardour/session_route.h b/libs/ardour/ardour/session_route.h
index d6f212ec42..fe5f7ad8c0 100644
--- a/libs/ardour/ardour/session_route.h
+++ b/libs/ardour/ardour/session_route.h
@@ -76,6 +76,53 @@ Session::foreach_route (T *obj, void (T::*func)(Route&, A), A arg1, bool sort)
}
}
+
+template<class A> void
+Session::foreach_track (void (Track::*method)(A), A arg)
+{
+ boost::shared_ptr<RouteList> r = routes.reader();
+
+ for (RouteList::iterator i = r->begin(); i != r->end(); i++) {
+ boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
+ if (tr) {
+ (tr->*method) (arg);
+ }
+ }
+}
+
+template<class A1, class A2> void
+Session::foreach_track (void (Track::*method)(A1, A2), A1 arg1, A2 arg2)
+{
+ boost::shared_ptr<RouteList> r = routes.reader();
+
+ for (RouteList::iterator i = r->begin(); i != r->end(); i++) {
+ boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
+ if (tr) {
+ (tr->*method) (arg1, arg2);
+ }
+ }
+}
+
+template<class A> void
+Session::foreach_route (void (Route::*method)(A), A arg)
+{
+ boost::shared_ptr<RouteList> r = routes.reader();
+
+ for (RouteList::iterator i = r->begin(); i != r->end(); i++) {
+ ((*i).get()->*method) (arg);
+ }
+}
+
+template<class A1, class A2> void
+Session::foreach_route (void (Route::*method)(A1, A2), A1 arg1, A2 arg2)
+{
+ boost::shared_ptr<RouteList> r = routes.reader();
+
+ for (RouteList::iterator i = r->begin(); i != r->end(); i++) {
+ ((*i).get()->*method) (arg1, arg2);
+ }
+}
+
} /* namespace */
#endif /* __ardour_session_route_h__ */