From 4ccad6eae499beb47f1fafac02a499e40b9ca85f Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 25 Feb 2021 19:53:14 +0100 Subject: [PATCH] Fix pasting processors pre-fader #7416 Previously when using index == 0, a hidden processor (Recorder or Delayline) would be returned instead of the first actual processor. --- libs/ardour/route.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index a90476db0e..1f134a15a5 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -814,7 +814,7 @@ Route::before_processor_for_placement (Placement p) } /** Supposing that we want to insert a Processor at a given index, return - * the processor to add the new one before (or 0 to add at the end). + * the processor to add the new one before (or -1 to add at the end). */ boost::shared_ptr Route::before_processor_for_index (int index) @@ -827,7 +827,7 @@ Route::before_processor_for_index (int index) ProcessorList::iterator i = _processors.begin (); int j = 0; - while (i != _processors.end() && j < index) { + while (i != _processors.end() && (!(*i)->display_to_user() || j < index)) { if ((*i)->display_to_user()) { ++j; }