From 0d3c2a9dbf434d699c97721e61a8771daa935bec Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 28 Nov 2016 15:36:04 +0100 Subject: Speed up track deletion when Editor-Mixer is visible --- gtk2_ardour/editor_ops.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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); -- cgit v1.2.3