From 9b1440ab237d19bc1d32c9236a94e4a473bad2bf Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 29 Apr 2022 03:37:01 +0200 Subject: [PATCH] Use new Route fed-by API (1/2) --- gtk2_ardour/foldback_strip.cc | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) diff --git a/gtk2_ardour/foldback_strip.cc b/gtk2_ardour/foldback_strip.cc index afce9a755d..3d2c3534c5 100644 --- a/gtk2_ardour/foldback_strip.cc +++ b/gtk2_ardour/foldback_strip.cc @@ -656,16 +656,9 @@ FoldbackStrip::update_send_box () StripableList stripables; stripables.clear (); -#if 0 - Route::FedBy fed_by = _route->fed_by (); - for (Route::FedBy::iterator i = fed_by.begin (); i != fed_by.end (); ++i) { - if (i->sends_only) { - boost::shared_ptr rt (i->r.lock ()); - boost::shared_ptr s = boost::dynamic_pointer_cast (rt); - stripables.push_back (s); - } + for (auto const& s : _route->signal_sources (true)) { + stripables.push_back (s); } -#endif stripables.sort (StripableByPresentationOrder ()); for (StripableList::iterator it = stripables.begin (); it != stripables.end (); ++it) { boost::shared_ptr s_sp = *it; @@ -1078,23 +1071,17 @@ FoldbackStrip::duplicate_current_fb () double oldgain = old_fb->gain_control ()->get_value (); new_fb->gain_control ()->set_value (oldgain * 0.25, PBD::Controllable::NoGroup); -#if 0 - Route::FedBy fed_by = old_fb->fed_by (); - for (Route::FedBy::iterator i = fed_by.begin (); i != fed_by.end (); ++i) { - if (i->sends_only) { - boost::shared_ptr rt (i->r.lock ()); - boost::shared_ptr old_snd = rt->internal_send_for (old_fb); - boost::shared_ptr old_proc = old_snd; - bool old_pre = old_proc->get_pre_fader (); - rt->add_foldback_send (new_fb, !old_pre); - if (old_snd) { - float old_gain = old_snd->gain_control ()->get_value (); - boost::shared_ptr new_snd = rt->internal_send_for (new_fb); - new_snd->gain_control ()->set_value (old_gain, PBD::Controllable::NoGroup); - } + for (auto const& rt : old_fb->signal_sources (true)) { + boost::shared_ptr old_snd = rt->internal_send_for (old_fb); + boost::shared_ptr old_proc = old_snd; + bool old_pre = old_proc->get_pre_fader (); + rt->add_foldback_send (new_fb, !old_pre); + if (old_snd) { + float old_gain = old_snd->gain_control ()->get_value (); + boost::shared_ptr new_snd = rt->internal_send_for (new_fb); + new_snd->gain_control ()->set_value (old_gain, PBD::Controllable::NoGroup); } } -#endif set_route (new_fb); route_rename (); } else {