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)));
/* 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;
}
}
}
break;
+ case NoteItem:
+ if (press && event->button.button == 3) {
+ NoteBase* cnote = reinterpret_cast<NoteBase*> (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;
}