diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 9b69243c58..115b818790 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -622,6 +622,12 @@ MixerStrip::set_packed (bool yn) } +struct RouteCompareByName { + bool operator() (boost::shared_ptr a, boost::shared_ptr b) { + return a->name().compare (b->name()) < 0; + } +}; + gint MixerStrip::output_press (GdkEventButton *ev) { @@ -667,7 +673,9 @@ MixerStrip::output_press (GdkEventButton *ev) } boost::shared_ptr routes = _session->get_routes (); - for (ARDOUR::RouteList::const_iterator i = routes->begin(); i != routes->end(); ++i) { + 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); } @@ -777,7 +785,9 @@ MixerStrip::input_press (GdkEventButton *ev) } boost::shared_ptr routes = _session->get_routes (); - for (ARDOUR::RouteList::const_iterator i = routes->begin(); i != routes->end(); ++i) { + RouteList copy = *routes; + copy.sort (RouteCompareByName ()); + for (ARDOUR::RouteList::const_iterator i = copy.begin(); i != copy.end(); ++i) { maybe_add_bundle_to_input_menu ((*i)->output()->bundle(), current); }