_display.get_selection()->set_mode (SELECTION_SINGLE);
_display.get_selection()->set_select_function (sigc::mem_fun (*this, &EditorRoutes::selection_filter));
_display.set_reorderable (true);
_display.get_selection()->set_mode (SELECTION_SINGLE);
_display.get_selection()->set_select_function (sigc::mem_fun (*this, &EditorRoutes::selection_filter));
_display.set_reorderable (true);
_display.set_rules_hint (true);
_display.set_size_request (100, -1);
_display.add_object_drag (_columns.route.index(), "routes");
_display.set_rules_hint (true);
_display.set_size_request (100, -1);
_display.add_object_drag (_columns.route.index(), "routes");
for (list<RouteTimeAxisView*>::iterator x = routes.begin(); x != routes.end(); ++x) {
boost::shared_ptr<MidiTrack> midi_trk = boost::dynamic_pointer_cast<MidiTrack> ((*x)->route());
for (list<RouteTimeAxisView*>::iterator x = routes.begin(); x != routes.end(); ++x) {
boost::shared_ptr<MidiTrack> midi_trk = boost::dynamic_pointer_cast<MidiTrack> ((*x)->route());
(*x)->route()->solo_isolated_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_isolate_display, this), gui_context());
(*x)->route()->solo_safe_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_safe_display, this), gui_context());
(*x)->route()->active_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_active_display, this), gui_context ());
(*x)->route()->solo_isolated_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_isolate_display, this), gui_context());
(*x)->route()->solo_safe_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_solo_safe_display, this), gui_context());
(*x)->route()->active_changed.connect (*this, MISSING_INVALIDATOR, boost::bind (&EditorRoutes::update_active_display, this), gui_context ());
update_solo_safe_display ();
update_input_active_display ();
update_active_display ();
update_solo_safe_display ();
update_input_active_display ();
update_active_display ();
if (what == "track_height") {
/* Optional :make tracks change height while it happens, instead
if (what == "track_height") {
/* Optional :make tracks change height while it happens, instead
for (TreeModel::Children::iterator ri = rows.begin(); ri != rows.end(); ++ri, ++old_order) {
boost::shared_ptr<Route> route = (*ri)[_columns.route];
for (TreeModel::Children::iterator ri = rows.begin(); ri != rows.end(); ++ri, ++old_order) {
boost::shared_ptr<Route> route = (*ri)[_columns.route];
- uint32_t new_order = route->order_key (EditorSort);
-
- DEBUG_TRACE (DEBUG::OrderKeys, string_compose ("EDITOR change order for %1 from %2 to %3\n",
- route->name(), old_order, new_order));
-
- neworder[new_order] = old_order;
+ sorted_routes.push_back (RoutePlusOrderKey (route, old_order, route->order_key (EditorSort)));
+ }
+
+ SortByNewDisplayOrder cmp;
- if (old_order != new_order) {
+ sort (sorted_routes.begin(), sorted_routes.end(), cmp);
+ neworder.assign (sorted_routes.size(), 0);
+
+ uint32_t n = 0;
+
+ for (OrderKeySortedRoutes::iterator sr = sorted_routes.begin(); sr != sorted_routes.end(); ++sr, ++n) {
+
+ neworder[n] = sr->old_display_order;
+
+ if (sr->old_display_order != n) {
- if (Config->get_solo_control_is_listen_control()) {
- _session->set_listen (rl, !rl->front()->listening_via_monitor(), Session::rt_cleanup);
- } else {
- _session->set_solo (rl, !rl->front()->self_soloed(), Session::rt_cleanup);
+ if (get_relevant_routes (rl)) {
+ if (Config->get_solo_control_is_listen_control()) {
+ _session->set_listen (rl, !rl->front()->listening_via_monitor(), Session::rt_cleanup);
+ } else {
+ _session->set_solo (rl, !rl->front()->self_soloed(), Session::rt_cleanup);
+ }