From 56edd3767c7e559711289858ded1afa3a5d74816 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 30 Sep 2017 18:54:47 +0200 Subject: [PATCH] NO-OP, re-order code, put all *roll() methods next to each other. --- libs/ardour/route.cc | 96 ++++++++++++++++++++++---------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 73b3ee7662..0f8c892b24 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -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) +void +Route::flush_processors () { - Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK); + Glib::Threads::RWLock::ReaderLock lm (_processor_lock); - if (!lm.locked()) { - return 0; + for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { + (*i)->flush (); } - - 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) -{ - /* 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. - - 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; } samplecnt_t @@ -3736,6 +3703,49 @@ Route::roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample return 0; } +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) +{ + /* 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. + + 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 */) { @@ -3744,16 +3754,6 @@ Route::silent_roll (pframes_t nframes, samplepos_t /*start_sample*/, samplepos_t return 0; } -void -Route::flush_processors () -{ - Glib::Threads::RWLock::ReaderLock lm (_processor_lock); - - for (ProcessorList::iterator i = _processors.begin(); i != _processors.end(); ++i) { - (*i)->flush (); - } -} - #ifdef __clang__ __attribute__((annotate("realtime"))) #endif