summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_routes.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/editor_routes.cc')
-rw-r--r--gtk2_ardour/editor_routes.cc33
1 files changed, 28 insertions, 5 deletions
diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc
index 38706a6525..5da4979824 100644
--- a/gtk2_ardour/editor_routes.cc
+++ b/gtk2_ardour/editor_routes.cc
@@ -70,6 +70,7 @@ EditorRoutes::EditorRoutes (Editor* e)
, _ignore_reorder (false)
, _no_redisplay (false)
, _adding_routes (false)
+ , _route_deletion_in_progress (false)
, _menu (0)
, old_focus (0)
, selection_countdown (0)
@@ -271,7 +272,7 @@ EditorRoutes::EditorRoutes (Editor* e)
active_col->set_fixed_width (30);
active_col->set_alignment (ALIGN_CENTER);
- _model->signal_row_deleted().connect (sigc::mem_fun (*this, &EditorRoutes::route_deleted));
+ _model->signal_row_deleted().connect (sigc::mem_fun (*this, &EditorRoutes::row_deleted));
_model->signal_rows_reordered().connect (sigc::mem_fun (*this, &EditorRoutes::reordered));
_display.signal_button_press_event().connect (sigc::mem_fun (*this, &EditorRoutes::button_press), false);
@@ -519,7 +520,6 @@ EditorRoutes::redisplay ()
/* show or hide the TimeAxisView */
if (visible) {
position += tv->show_at (position, n, &_editor->edit_controls_vbox);
- // SHOWTRACKS
} else {
tv->hide ();
}
@@ -547,18 +547,38 @@ EditorRoutes::redisplay ()
}
void
-EditorRoutes::route_deleted (Gtk::TreeModel::Path const &)
+EditorRoutes::row_deleted (Gtk::TreeModel::Path const &)
{
- /* this happens as the second step of a DnD within the treeview as well
- as when a row/route is actually deleted.
+ /* this happens as the second step of a DnD within the treeview, and
+ when a route is actually removed. we don't differentiate between
+ the two cases.
+
+ note that the sync_orders_keys() step may not actually change any
+ RID's (e.g. the last track may be removed, so all other tracks keep
+ the same RID), which means that no redisplay would happen. so we
+ have to force a redisplay.
*/
+
DEBUG_TRACE (DEBUG::OrderKeys, "editor routes treeview row deleted\n");
+
+ if (_route_deletion_in_progress) {
+ suspend_redisplay ();
+ }
+
sync_order_keys_from_treeview ();
+
+ if (_route_deletion_in_progress) {
+ resume_redisplay ();
+ }
}
void
EditorRoutes::reordered (TreeModel::Path const &, TreeModel::iterator const &, int* /*what*/)
{
+ /* reordering implies that RID's will change, so sync_order_keys() will
+ cause a redisplay.
+ */
+
DEBUG_TRACE (DEBUG::OrderKeys, "editor routes treeview reordered\n");
sync_order_keys_from_treeview ();
}
@@ -721,10 +741,13 @@ EditorRoutes::route_removed (TimeAxisView *tv)
TreeModel::Children rows = _model->children();
TreeModel::Children::iterator ri;
+ bool found = false;
for (ri = rows.begin(); ri != rows.end(); ++ri) {
if ((*ri)[_columns.tv] == tv) {
+ PBD::Unwinder<bool> uw (_route_deletion_in_progress, true);
_model->erase (ri);
+ found = true;
break;
}
}