summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-11-28 15:36:04 +0100
committerRobin Gareus <robin@gareus.org>2016-11-28 15:36:04 +0100
commit0d3c2a9dbf434d699c97721e61a8771daa935bec (patch)
tree0c025e717e17f2bc685d1f2ecddfa41247e96d6e
parent7b687d08a19a74af3b84ec310150be7576c9ee9d (diff)
Speed up track deletion when Editor-Mixer is visible
-rw-r--r--gtk2_ardour/editor_ops.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 643780a490..25d1c73766 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -7388,6 +7388,23 @@ edit your ardour.rc file to set the\n\
return;
}
+ if (current_mixer_strip && routes.size () > 1 && std::find (routes.begin(), routes.end(), current_mixer_strip->route()) != routes.end ()) {
+ /* Route deletion calls Editor::timeaxisview_deleted() iteratively (for each deleted
+ * route). If the deleted route is currently displayed in the Editor-Mixer (highly
+ * likely because deletion requires selection) this will call
+ * Editor::set_selected_mixer_strip () which is expensive ( MixerStrip::set_route() ).
+ * It's likewise likely that the route that has just been displayed in the
+ * Editor-Mixer will be next in line for deletion.
+ *
+ * So simply switch to the master-bus (if present)
+ */
+ for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
+ if ((*i)->stripable ()->is_master ()) {
+ set_selected_mixer_strip (*(*i));
+ break;
+ }
+ }
+ }
Mixer_UI::instance()->selection().block_routes_changed (true);
selection->block_tracks_changed (true);