diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 9628928004..9b14bcdaaf 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -4605,7 +4605,7 @@ Command* Editor::apply_midi_note_edit_op_to_region (MidiOperator& op, MidiRegionView& mrv) { Evoral::Sequence::Notes selected; - mrv.selection_as_notelist (selected); + mrv.selection_as_notelist (selected, true); vector::Notes> v; v.push_back (selected); diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index b9bbff74d1..d1c1656ce3 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -2648,13 +2648,22 @@ MidiRegionView::goto_previous_note () } void -MidiRegionView::selection_as_notelist (Notes& selected) +MidiRegionView::selection_as_notelist (Notes& selected, bool allow_all_if_none_selected) { + bool had_selected = false; + time_sort_events (); for (Events::iterator i = _events.begin(); i != _events.end(); ++i) { if ((*i)->selected()) { selected.insert ((*i)->note()); + had_selected = true; + } + } + + if (allow_all_if_none_selected && !had_selected) { + for (Events::iterator i = _events.begin(); i != _events.end(); ++i) { + selected.insert ((*i)->note()); } } } diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h index 21d81cf2f8..3417014b43 100644 --- a/gtk2_ardour/midi_region_view.h +++ b/gtk2_ardour/midi_region_view.h @@ -292,7 +292,7 @@ class MidiRegionView : public RegionView void show_list_editor (); - void selection_as_notelist (Notes& selected); + void selection_as_notelist (Notes& selected, bool allow_all_if_none_selected = false); protected: /** Allows derived types to specify their visibility requirements diff --git a/gtk2_ardour/quantize_dialog.cc b/gtk2_ardour/quantize_dialog.cc index 727f2b0db9..fae5813542 100644 --- a/gtk2_ardour/quantize_dialog.cc +++ b/gtk2_ardour/quantize_dialog.cc @@ -173,7 +173,7 @@ QuantizeDialog::end_grid_size () const double QuantizeDialog::grid_size_to_musical_time (const string& txt) const { - if (txt == "main_grid") { + if (txt == "main grid") { bool success; Evoral::MusicalTime b = editor.get_grid_type_as_beats (success, 0); @@ -200,7 +200,7 @@ QuantizeDialog::grid_size_to_musical_time (const string& txt) const } else if (txt == _("Beats")) { return 1.0; } - + return 1.0; }