summaryrefslogtreecommitdiff
path: root/libs/ardour/session.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2020-05-07 12:38:09 -0600
committerPaul Davis <paul@linuxaudiosystems.com>2020-05-07 17:40:20 -0600
commit490fac163211d71ca640da1d072de888f380e643 (patch)
tree95a1f6958fe63c1a493ca30c58ec431b33ae1c24 /libs/ardour/session.cc
parent95d9f600355b494a982ba3e4f6fe87e70c01f12e (diff)
add new template methods for "foreach {route,track}" and use them
Also remove redundant double call to Track::set_block_size(). This dates back to 2010 when there used be an additional traversal of the Diskstream RCU-managed list, before they became owned by Tracks
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r--libs/ardour/session.cc15
1 files changed, 2 insertions, 13 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 5242ab28ad..1a84fe4f86 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -109,6 +109,7 @@
#include "ardour/session.h"
#include "ardour/session_directory.h"
#include "ardour/session_playlists.h"
+#include "ardour/session_route.h"
#include "ardour/smf_source.h"
#include "ardour/solo_isolate_control.h"
#include "ardour/source_factory.h"
@@ -2080,19 +2081,7 @@ Session::set_block_size (pframes_t nframes)
ensure_buffers ();
- boost::shared_ptr<RouteList> r = routes.reader ();
-
- for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
- (*i)->set_block_size (nframes);
- }
-
- boost::shared_ptr<RouteList> rl = routes.reader ();
- for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
- boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
- if (tr) {
- tr->set_block_size (nframes);
- }
- }
+ foreach_route (&Route::set_block_size, nframes);
DEBUG_TRACE (DEBUG::LatencyCompensation, "Session::set_block_size -> update worst i/o latency\n");
/* when this is called from the auto-connect thread, the process-lock is held */