try to restore original semantics for scheduling butler transport work in Session...
[ardour.git] / gtk2_ardour / editor_routes.cc
index 7fc069e17713d96bb194a08bffc0f3396fffbed4..21e8075d1adeeb1426aa3cd825549cef0024446c 100644 (file)
@@ -516,7 +516,7 @@ EditorRoutes::redisplay_real ()
                }
 
                bool visible = tv->marked_for_display ();
-
+               
                /* show or hide the TimeAxisView */
                if (visible) {
                        position += tv->show_at (position, n, &_editor->edit_controls_vbox);
@@ -556,14 +556,13 @@ EditorRoutes::redisplay ()
        // model deprecated g_atomic_int_exchange_and_add(, 1)
        g_atomic_int_inc(&_redisplay_active);
        if (!g_atomic_int_compare_and_exchange (&_redisplay_active, 1, 1)) {
-               printf ("SKIP redisplay\n");
                return;
        }
 
        redisplay_real ();
 
        while (!g_atomic_int_compare_and_exchange (&_redisplay_active, 1, 0)) {
-               g_atomic_pointer_set(&_redisplay_active, 1);
+               g_atomic_int_set(&_redisplay_active, 1);
                redisplay_real ();
        }
 }
@@ -811,7 +810,7 @@ EditorRoutes::update_visibility ()
        TreeModel::Children rows = _model->children();
        TreeModel::Children::iterator i;
 
-       DisplaySuspender ds ();
+       DisplaySuspender ds;
 
        for (i = rows.begin(); i != rows.end(); ++i) {
                TimeAxisView *tv = (*i)[_columns.tv];
@@ -1326,6 +1325,8 @@ EditorRoutes::button_press (GdkEventButton* ev)
 void
 EditorRoutes::selection_changed ()
 {
+       _editor->begin_reversible_selection_op (X_("Select Track from Route List"));
+
        if (_display.get_selection()->count_selected_rows() > 0) {
 
                TreeIter iter;
@@ -1350,6 +1351,8 @@ EditorRoutes::selection_changed ()
        } else {
                _editor->get_selection().clear_tracks ();
        }
+
+       _editor->commit_reversible_selection_op ();
 }
 
 bool
@@ -1596,26 +1599,25 @@ EditorRoutes::idle_update_mute_rec_solo_etc()
                (*i)[_columns.solo_isolate_state] = RouteUI::solo_isolate_active_state (route) ? 1 : 0;
                (*i)[_columns.solo_safe_state] = RouteUI::solo_safe_active_state (route) ? 1 : 0;
                (*i)[_columns.active] = route->active ();
-               {
-                       if (boost::dynamic_pointer_cast<Track> (route)) {
-                               boost::shared_ptr<MidiTrack> mt = boost::dynamic_pointer_cast<MidiTrack> (route);
-
-                               if (route->record_enabled()) {
-                                       if (_session->record_status() == Session::Recording) {
-                                               (*i)[_columns.rec_state] = 1;
-                                       } else {
-                                               (*i)[_columns.rec_state] = 2;
-                                       }
-                               } else if (mt && mt->step_editing()) {
-                                       (*i)[_columns.rec_state] = 3;
+               if (boost::dynamic_pointer_cast<Track> (route)) {
+                       boost::shared_ptr<MidiTrack> mt = boost::dynamic_pointer_cast<MidiTrack> (route);
+                       
+                       if (route->record_enabled()) {
+                               if (_session->record_status() == Session::Recording) {
+                                       (*i)[_columns.rec_state] = 1;
                                } else {
-                                       (*i)[_columns.rec_state] = 0;
+                                       (*i)[_columns.rec_state] = 2;
                                }
-
-                               (*i)[_columns.name_editable] = !route->record_enabled ();
+                       } else if (mt && mt->step_editing()) {
+                               (*i)[_columns.rec_state] = 3;
+                       } else {
+                               (*i)[_columns.rec_state] = 0;
                        }
+                       
+                       (*i)[_columns.name_editable] = !route->record_enabled ();
                }
        }
+
        return false; // do not call again (until needed)
 }