NO-OP, re-order code, put all *roll() methods next to each other.
authorRobin Gareus <robin@gareus.org>
Sat, 30 Sep 2017 16:54:47 +0000 (18:54 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 30 Sep 2017 16:54:47 +0000 (18:54 +0200)
libs/ardour/route.cc

index 73b3ee7662fa3eaf544b9dbbb43141564528b070..0f8c892b2498b56dafe0a45de23a062db297a3f9 100644 (file)
@@ -3626,47 +3626,14 @@ Route::flush_processor_buffers_locked (samplecnt_t nframes)
        }
 }
 
-int
-Route::no_roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool session_state_changing)
-{
-       Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
-
-       if (!lm.locked()) {
-               return 0;
-       }
-
-       return no_roll_unlocked (nframes, start_sample, end_sample, session_state_changing);
-}
-
-int
-Route::no_roll_unlocked (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool session_state_changing)
+void
+Route::flush_processors ()
 {
-       /* Must be called with the processor lock held */
-
-       if (!_active) {
-               silence_unlocked (nframes);
-               _meter->reset();
-               return 0;
-       }
-
-       if (session_state_changing) {
-               if (_session.transport_speed() != 0.0f) {
-                       /* we're rolling but some state is changing (e.g. our diskstream contents)
-                          so we cannot use them. Be silent till this is over.
+       Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
 
-                          XXX note the absurdity of ::no_roll() being called when we ARE rolling!
-                       */
-                       silence_unlocked (nframes);
-                       _meter->reset();
-                       return 0;
-               }
-               /* we're really not rolling, so we're either delivery silence or actually
-                  monitoring, both of which are safe to do while session_state_changing is true.
-               */
+       for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
+               (*i)->flush ();
        }
-
-       run_route (start_sample, end_sample, nframes, 0, false, false);
-       return 0;
 }
 
 samplecnt_t
@@ -3737,21 +3704,54 @@ Route::roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample
 }
 
 int
-Route::silent_roll (pframes_t nframes, samplepos_t /*start_sample*/, samplepos_t /*end_sample*/, bool& /* need_butler */)
+Route::no_roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool session_state_changing)
 {
-       silence (nframes);
-       flush_processor_buffers_locked (nframes);
-       return 0;
+       Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK);
+
+       if (!lm.locked()) {
+               return 0;
+       }
+
+       return no_roll_unlocked (nframes, start_sample, end_sample, session_state_changing);
 }
 
-void
-Route::flush_processors ()
+int
+Route::no_roll_unlocked (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool session_state_changing)
 {
-       Glib::Threads::RWLock::ReaderLock lm (_processor_lock);
+       /* Must be called with the processor lock held */
 
-       for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) {
-               (*i)->flush ();
+       if (!_active) {
+               silence_unlocked (nframes);
+               _meter->reset();
+               return 0;
        }
+
+       if (session_state_changing) {
+               if (_session.transport_speed() != 0.0f) {
+                       /* we're rolling but some state is changing (e.g. our diskstream contents)
+                          so we cannot use them. Be silent till this is over.
+
+                          XXX note the absurdity of ::no_roll() being called when we ARE rolling!
+                       */
+                       silence_unlocked (nframes);
+                       _meter->reset();
+                       return 0;
+               }
+               /* we're really not rolling, so we're either delivery silence or actually
+                  monitoring, both of which are safe to do while session_state_changing is true.
+               */
+       }
+
+       run_route (start_sample, end_sample, nframes, 0, false, false);
+       return 0;
+}
+
+int
+Route::silent_roll (pframes_t nframes, samplepos_t /*start_sample*/, samplepos_t /*end_sample*/, bool& /* need_butler */)
+{
+       silence (nframes);
+       flush_processor_buffers_locked (nframes);
+       return 0;
 }
 
 #ifdef __clang__