From 57a1dbb3758a765ea18efcb829cf14d78eaef167 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 3 Jun 2022 22:43:14 +0200 Subject: [PATCH] Update route API for silent processing --- libs/ardour/ardour/route.h | 5 ++--- libs/ardour/route.cc | 17 +++++------------ 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index f43619172d..d4f9d903c4 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -152,7 +152,7 @@ public: int no_roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool state_changing); - int silent_roll (pframes_t nframes, samplepos_t start_sample, samplepos_t end_sample, bool& need_butler); + int silence (pframes_t); virtual bool declick_in_progress () const { return false; } virtual bool can_record() { return false; } @@ -684,8 +684,7 @@ protected: int configure_processors (ProcessorStreams*); - void silence (samplecnt_t); - void silence_unlocked (samplecnt_t); + void silence_unlocked (pframes_t); ChanCount processor_max_streams; ChanCount processor_out_streams; diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 5d03832a74..028ae4a76f 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -3328,19 +3328,20 @@ Route::set_processor_state (XMLNode const& node, int version, XMLProperty const* return true; } -void -Route::silence (samplecnt_t nframes) +int +Route::silence (pframes_t nframes) { Glib::Threads::RWLock::ReaderLock lm (_processor_lock, Glib::Threads::TRY_LOCK); if (!lm.locked()) { - return; + return 1; } silence_unlocked (nframes); + return 0; } void -Route::silence_unlocked (samplecnt_t nframes) +Route::silence_unlocked (pframes_t nframes) { /* Must be called with the processor lock held */ @@ -4054,14 +4055,6 @@ Route::no_roll_unlocked (pframes_t nframes, samplepos_t start_sample, samplepos_ 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; -} - void Route::update_send_delaylines () {