diff options
author | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2017-08-22 16:04:16 +0200 |
---|---|---|
committer | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2017-08-23 23:31:10 +0200 |
commit | cc63df7e8d7e7f1ed255773398ff30c23205153c (patch) | |
tree | 3c9c593fc06c3562a98afec6da4fe7f94c7bc566 /gtk2_ardour/mixer_strip.cc | |
parent | 452e22e9c91b9872a59eba9f0c13199d5b32d34d (diff) |
Populate strips output menus with a more user-friendly heuristic
Ensure the master bus is the first proposed bundle if it is present.
Also propose internal route inputs before physical outs or other
software via JACK.
Last, but not least, add to the menu not only exactly matching bundles,
but also bundles that have the same number of channels than the route
output when considering only the DataType we think the user wants to
use. This covers both the case of a MIDI+STEREO instrument track
connecting to master, and the case of a STEREO track connecting to a
MIDI+STEREO vocoder track.
Diffstat (limited to 'gtk2_ardour/mixer_strip.cc')
-rw-r--r-- | gtk2_ardour/mixer_strip.cc | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index f459237000..dc8813dbd7 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -904,27 +904,37 @@ MixerStrip::output_press (GdkEventButton *ev) boost::shared_ptr<ARDOUR::BundleList> b = _session->bundles (); - /* give user bundles first chance at being in the menu */ + /* guess the user-intended main type of the route output */ + DataType intended_type = guess_main_type(false); + + /* try adding the master bus first */ + boost::shared_ptr<Route> master = _session->master_out(); + if (master) { + maybe_add_bundle_to_output_menu (master->input()->bundle(), current, intended_type); + } + /* then other routes inputs */ + boost::shared_ptr<ARDOUR::RouteList> routes = _session->get_routes (); + RouteList copy = *routes; + copy.sort (RouteCompareByName ()); + for (ARDOUR::RouteList::const_iterator i = copy.begin(); i != copy.end(); ++i) { + maybe_add_bundle_to_output_menu ((*i)->input()->bundle(), current, intended_type); + } + + /* then try adding user bundles, often labeled/grouped physical inputs */ for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) { if (boost::dynamic_pointer_cast<UserBundle> (*i)) { - maybe_add_bundle_to_output_menu (*i, current); + maybe_add_bundle_to_output_menu (*i, current, intended_type); } } + /* then all other bundles, including physical outs or other sofware */ for (ARDOUR::BundleList::iterator i = b->begin(); i != b->end(); ++i) { if (boost::dynamic_pointer_cast<UserBundle> (*i) == 0) { - maybe_add_bundle_to_output_menu (*i, current); + maybe_add_bundle_to_output_menu (*i, current, intended_type); } } - boost::shared_ptr<ARDOUR::RouteList> routes = _session->get_routes (); - RouteList copy = *routes; - copy.sort (RouteCompareByName ()); - for (ARDOUR::RouteList::const_iterator i = copy.begin(); i != copy.end(); ++i) { - maybe_add_bundle_to_output_menu ((*i)->input()->bundle(), current); - } - if (citems.size() == n_with_separator) { /* no routes added; remove the separator */ citems.pop_back (); |