diff options
author | Robin Gareus <robin@gareus.org> | 2016-05-26 15:42:33 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2016-05-26 15:42:33 +0200 |
commit | 56471fd3527416672664700bd2c1491419ced57a (patch) | |
tree | a9827c9527a326d1391f0156e7342fc588b1b1b5 /libs/ardour/route.cc | |
parent | 00967a19829cc6aab30eefecdd1deef29c7c9d33 (diff) |
ensure that amp/fader is present on every route
Diffstat (limited to 'libs/ardour/route.cc')
-rw-r--r-- | libs/ardour/route.cc | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 6cd593d5ad..49528e30e3 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -172,14 +172,9 @@ Route::init () _output->changed.connect_same_thread (*this, boost::bind (&Route::output_change_handler, this, _1, _2)); _output->PortCountChanging.connect_same_thread (*this, boost::bind (&Route::output_port_count_changing, this, _1)); -#if 0 // not used - just yet - if (!is_master() && !is_monitor() && !is_auditioner()) { - _delayline.reset (new DelayLine (_session, _name)); - add_processor (_delayline, PreFader); - } -#endif - - /* add amp processor */ + /* add the amp/fader processor. + * it should be the first processor to be added on every route. + */ _gain_control = boost::shared_ptr<GainControllable> (new GainControllable (_session, GainAutomation, shared_from_this ())); add_control (_gain_control); @@ -191,6 +186,13 @@ Route::init () _amp->set_display_name (_("Monitor")); } +#if 0 // not used - just yet + if (!is_master() && !is_monitor() && !is_auditioner()) { + _delayline.reset (new DelayLine (_session, _name)); + add_processor (_delayline, PreFader); + } +#endif + /* and input trim */ _trim_control = boost::shared_ptr<GainControllable> (new GainControllable (_session, TrimAutomation, shared_from_this ())); @@ -5051,12 +5053,13 @@ Route::setup_invisible_processors () /* find the amp */ - ProcessorList::iterator amp = new_processors.begin (); - while (amp != new_processors.end() && *amp != _amp) { - ++amp; - } + ProcessorList::iterator amp = find (new_processors.begin(), new_processors.end(), _amp); - assert (amp != new_processors.end ()); + if (amp == new_processors.end ()) { + error << string_compose (_("Amp/Fader on Route '%1' went AWOL. Re-added."), name()) << endmsg; + new_processors.push_front (_amp); + amp = find (new_processors.begin(), new_processors.end(), _amp); + } /* and the processor after the amp */ |