From 1610b0baae4d6b4d99424892ec9310ad50cb374a Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 4 Feb 2021 00:10:42 +0100 Subject: [PATCH] MonitorSection: fade input in/out for AFL/PFL This slowly un/mutes the direct monitor signal when listen state changes. Listen sends already fade in as well. However un-soloing still hard-removes the listen send path. --- libs/ardour/ardour/route.h | 1 + libs/ardour/route.cc | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/libs/ardour/ardour/route.h b/libs/ardour/ardour/route.h index b500370cc4..8680b878ce 100644 --- a/libs/ardour/ardour/route.h +++ b/libs/ardour/ardour/route.h @@ -789,6 +789,7 @@ private: bool _in_configure_processors; bool _initial_io_setup; bool _in_sidechain_setup; + gain_t _monitor_gain; /** true if we've made a note of a custom meter position in these variables */ bool _custom_meter_position_noted; diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index f925543558..638d9dd837 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -131,6 +131,7 @@ Route::Route (Session& sess, string name, PresentationInfo::Flag flag, DataType , _in_configure_processors (false) , _initial_io_setup (false) , _in_sidechain_setup (false) + , _monitor_gain (0) , _custom_meter_position_noted (false) , _pinmgr_proxy (0) , _patch_selector_dialog (0) @@ -696,14 +697,13 @@ Route::run_route (samplepos_t start_sample, samplepos_t end_sample, pframes_t nf /* filter captured data before meter sees it */ filter_input (bufs); - if (is_monitor() && _session.listening() && !_session.is_auditioning()) { - + if (is_monitor()) { /* control/monitor bus ignores input ports when something is - feeding the listen "stream". data will "arrive" into the - route from the intreturn processor element. - */ - - bufs.silence (nframes, 0); + * feeding the listen "stream". data will "arrive" into the + * route from the intreturn processor element. + */ + gain_t monitor_target_gain = _session.listening() && !_session.is_auditioning() ? 0. : 1.; + _monitor_gain = Amp::apply_gain (bufs, _session.nominal_sample_rate (), nframes, _monitor_gain, monitor_target_gain); } snapshot_out_of_band_data (nframes);