- items.push_back (MenuElem (_("Remove"), sigc::bind (sigc::mem_fun(*this, &RouteUI::remove_this_route), false)));
+
+ if (_route) {
+ /* note that this relies on selection being shared across editor and
+ mixer (or global to the backend, in the future), which is the only
+ sane thing for users anyway.
+ */
+
+ RouteTimeAxisView* rtav = PublicEditor::instance().get_route_view_by_route_id (_route->id());
+ if (rtav) {
+ Selection& selection (PublicEditor::instance().get_selection());
+ if (!selection.selected (rtav)) {
+ selection.set (rtav);
+ }
+
+ items.push_front (MenuElem (_("Remove"), sigc::mem_fun(PublicEditor::instance(), &PublicEditor::remove_tracks)));
+ }
+ }