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.
This commit is contained in:
@@ -904,25 +904,35 @@ 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);
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
/* 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);
|
||||
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, 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, intended_type);
|
||||
}
|
||||
}
|
||||
|
||||
if (citems.size() == n_with_separator) {
|
||||
|
||||
Reference in New Issue
Block a user