From ff1083128b8bf6744772398d240b017dad48f1d1 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 25 Mar 2021 01:54:48 +0100 Subject: [PATCH] Include Tracks and Busses in connection dropdown #8636 --- gtk2_ardour/io_button.cc | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/io_button.cc b/gtk2_ardour/io_button.cc index 401f381b38..287f86f9b3 100644 --- a/gtk2_ardour/io_button.cc +++ b/gtk2_ardour/io_button.cc @@ -235,12 +235,33 @@ IOButton::button_press (GdkEventButton* ev) RouteList copy = *routes; copy.sort (RouteCompareByName ()); - for (ARDOUR::RouteList::const_iterator i = copy.begin (); i != copy.end (); ++i) { - maybe_add_bundle_to_menu ((*i)->output ()->bundle (), current); - } - - if (!_input) { + if (_input) { + /* other routes outputs */ + for (ARDOUR::RouteList::const_iterator i = copy.begin (); i != copy.end (); ++i) { + if ((*i)->is_foldbackbus ()) { + continue; + } + if (_route->feeds_according_to_graph (*i)) { + /* do not offer connections that would cause feedback */ + continue; + } + maybe_add_bundle_to_menu ((*i)->output ()->bundle (), current); + } + } else { DataType intended_type = guess_main_type (); + + /* other routes inputs */ + for (ARDOUR::RouteList::const_iterator i = copy.begin(); i != copy.end(); ++i) { + if ((*i)->is_foldbackbus ()) { + continue; + } + if ((*i)->feeds_according_to_graph (_route)) { + /* do not offer connections that would cause feedback */ + continue; + } + maybe_add_bundle_to_menu ((*i)->input()->bundle(), current, intended_type); + } + /* then try adding user output bundles, often labeled/grouped physical inputs */ for (ARDOUR::BundleList::iterator i = b->begin (); i != b->end (); ++i) { if (boost::dynamic_pointer_cast (*i)) {