13
0

(1) make quantize actually use the main grid setting and not just default to beats (2) apply quantize to all notes if none are selected

git-svn-id: svn://localhost/ardour2/branches/3.0@7126 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-05-20 15:06:30 +00:00
parent c1e6410619
commit d443688c92
4 changed files with 14 additions and 5 deletions

View File

@ -4605,7 +4605,7 @@ Command*
Editor::apply_midi_note_edit_op_to_region (MidiOperator& op, MidiRegionView& mrv)
{
Evoral::Sequence<Evoral::MusicalTime>::Notes selected;
mrv.selection_as_notelist (selected);
mrv.selection_as_notelist (selected, true);
vector<Evoral::Sequence<Evoral::MusicalTime>::Notes> v;
v.push_back (selected);

View File

@ -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());
}
}
}

View File

@ -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

View File

@ -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;
}