Fix AFL position
authorRobin Gareus <robin@gareus.org>
Sat, 11 Jan 2020 16:48:42 +0000 (17:48 +0100)
committerRobin Gareus <robin@gareus.org>
Sat, 11 Jan 2020 16:48:42 +0000 (17:48 +0100)
* update AFL position when preference changes
* "after post-fader processors (before pan)" is before
  the main-out (not at the end).
* Fix "immediately post-fader":
  The amp, when added was the last element. ++after_end then
  made the iterator point to .end()

This likely worked in the past when the monitor send was added
immediately after adding the fader/amp before any other processors.

libs/ardour/route.cc
libs/ardour/session_state.cc

index 68a85d39bb64aa97686bb235cc41e8811057278f..0b67528ac992af17f093f56b5574705c024db5d5 100644 (file)
@@ -4845,10 +4845,6 @@ Route::setup_invisible_processors ()
                amp = find (new_processors.begin(), new_processors.end(), _amp);
        }
 
-       /* and the processor after the amp */
-
-       ProcessorList::iterator after_amp = amp;
-       ++after_amp;
 
        /* Pre-fader METER */
 
@@ -4865,7 +4861,6 @@ Route::setup_invisible_processors ()
        new_processors.push_back (_main_outs);
 
        /* iterator for the main outs */
-
        ProcessorList::iterator main = new_processors.end();
        --main;
 
@@ -4873,11 +4868,8 @@ Route::setup_invisible_processors ()
 
        if (_meter && (_meter_point == MeterOutput || _meter_point == MeterPostFader)) {
                assert (!_meter->display_to_user ());
-
                /* add the processor just before or just after the main outs */
-
                ProcessorList::iterator meter_point = main;
-
                if (_meter_point == MeterOutput) {
                        ++meter_point;
                }
@@ -4893,6 +4885,9 @@ Route::setup_invisible_processors ()
        /* MONITOR SEND */
 
        if (_monitor_send && !is_monitor ()) {
+               ProcessorList::iterator after_amp = amp;
+               ++after_amp;
+
                assert (!_monitor_send->display_to_user ());
                switch (Config->get_listen_position ()) {
                case PreFaderListen:
@@ -4912,7 +4907,7 @@ Route::setup_invisible_processors ()
                                new_processors.insert (after_amp, _monitor_send);
                                break;
                        case AFLFromAfterProcessors:
-                               new_processors.insert (new_processors.end(), _monitor_send);
+                               new_processors.insert (main, _monitor_send);
                                break;
                        }
                        _monitor_send->set_can_pan (true);
index f67c5df66cb4c53dad7e8ea80ea961a02923fe9c..430e0f95efa1a42539a9504c4acddde547f44d36 100644 (file)
@@ -4126,7 +4126,7 @@ Session::config_changed (std::string p, bool ours)
                }
        } else if (p == "solo-mute-override") {
                // catch_up_on_solo_mute_override ();
-       } else if (p == "listen-position" || p == "pfl-position") {
+       } else if (p == "listen-position" || p == "pfl-position" || p == "afl-position") {
                listen_position_changed ();
        } else if (p == "solo-control-is-listen-control") {
                solo_control_mode_changed ();