summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-04-13 22:43:22 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-04-13 22:43:22 -0400
commitedb9a24727e27b9873cbb06ebc72d94381f41ea9 (patch)
tree240d9a43a0dda457944087a2093c277d6f7ad0ce
parentaab777b490aa5ff929d6cb4d7ab6007e0c17a9f7 (diff)
when building context menu for click on mixer strip, ensure clicked-on strip sets selection appropriately
-rw-r--r--gtk2_ardour/mixer_strip.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 213c72ecab..6225f71b89 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -1543,11 +1543,23 @@ MixerStrip::build_route_ops_menu ()
}
items.push_back (SeparatorElem());
- /* 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.
- */
- items.push_front (MenuElem (_("Remove"), sigc::mem_fun(PublicEditor::instance(), &PublicEditor::remove_tracks)));
+
+ 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)));
+ }
+ }
}
gboolean