diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 4a559167e8..5601fd4987 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -5954,22 +5954,38 @@ Editor::popup_note_context_menu (ArdourCanvas::Item* item, GdkEvent* event) MidiRegionView& mrv = note->region_view(); const RegionSelection rs = get_regions_from_selection_and_entered (); + const uint32_t sel_size = mrv.selection_size (); MenuList& items = _note_context_menu.items(); items.clear(); - items.push_back(MenuElem(_("Delete"), - sigc::mem_fun(mrv, &MidiRegionView::delete_selection))); - items.push_back(MenuElem(_("Edit..."), - sigc::bind(sigc::mem_fun(*this, &Editor::edit_notes), &mrv))); + if (sel_size > 0) { + items.push_back(MenuElem(_("Delete"), + sigc::mem_fun(mrv, &MidiRegionView::delete_selection))); + } + + if (sel_size == 1) { + items.push_back(MenuElem(_("Edit..."), + sigc::bind(sigc::mem_fun(*this, &Editor::edit_notes), &mrv))); + } + items.push_back(MenuElem(_("Transpose..."), sigc::bind(sigc::mem_fun(*this, &Editor::transpose_regions), rs))); - items.push_back(MenuElem(_("Legatize"), - sigc::bind(sigc::mem_fun(*this, &Editor::legatize_regions), rs, false))); + + if (sel_size > 1) { + items.push_back(MenuElem(_("Legatize"), + sigc::bind(sigc::mem_fun(*this, &Editor::legatize_regions), rs, false))); + } + items.push_back(MenuElem(_("Quantize..."), sigc::bind(sigc::mem_fun(*this, &Editor::quantize_regions), rs))); - items.push_back(MenuElem(_("Remove Overlap"), - sigc::bind(sigc::mem_fun(*this, &Editor::legatize_regions), rs, true))); + + if (sel_size > 1) { + items.push_back(MenuElem(_("Remove Overlap"), + sigc::bind(sigc::mem_fun(*this, &Editor::legatize_regions), rs, true))); + + } + items.push_back(MenuElem(_("Transform..."), sigc::bind(sigc::mem_fun(*this, &Editor::transform_regions), rs))); diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 23961cef91..7740cb9b17 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -458,7 +458,9 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it /* almost no selection action on modified button-2 or button-3 events */ - if ((item_type != RegionItem && event->button.button != 2) && !(item_type == ControlPointItem && event->button.button == 3)) { + if ((item_type != RegionItem && event->button.button != 2) + /* for selection of control points prior to delete (shift-right click) */ + && !(item_type == ControlPointItem && event->button.button == 3 && event->type == GDK_BUTTON_PRESS)) { return; } } @@ -628,6 +630,20 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it } break; + case NoteItem: + if (press && event->button.button == 3) { + NoteBase* cnote = reinterpret_cast (item->get_data ("notebase")); + assert (cnote); + if (cnote->region_view().selection_size() == 0 || !cnote->selected()) { + selection->clear_points(); + cnote->region_view().unique_select (cnote); + /* we won't get the release, so store the selection change now */ + begin_reversible_selection_op (X_("Button 3 Note Selection")); + commit_reversible_selection_op (); + } + } + break; + default: break; }