mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
MIDI region extend-selection should select all after start of selection, not all after end of selection
This commit is contained in:
parent
11cb981e30
commit
c46410a1b0
1 changed files with 11 additions and 5 deletions
|
|
@ -2195,18 +2195,24 @@ MidiRegionView::extend_selection ()
|
||||||
|
|
||||||
/* find end of current selection */
|
/* find end of current selection */
|
||||||
|
|
||||||
samplepos_t last_note_end = 0;
|
/* XXX NUTEMPO WARNING */
|
||||||
|
samplepos_t first_note_start = max_samplepos;
|
||||||
|
|
||||||
for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) {
|
for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) {
|
||||||
samplepos_t e = source_beats_to_absolute_samples ((*i)->note()->end_time());
|
samplepos_t e = source_beats_to_absolute_samples ((*i)->note()->time());
|
||||||
if (e > last_note_end) {
|
if (e < first_note_start) {
|
||||||
last_note_end = e;
|
first_note_start = e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Events::iterator i = _events.begin(); i != _events.end(); ++i) {
|
for (Events::iterator i = _events.begin(); i != _events.end(); ++i) {
|
||||||
samplepos_t t = source_beats_to_absolute_samples(i->first->time());
|
samplepos_t t = source_beats_to_absolute_samples(i->first->time());
|
||||||
if (t >= last_note_end) {
|
|
||||||
|
if (i->second->selected()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (t >= first_note_start) {
|
||||||
add_to_selection (i->second);
|
add_to_selection (i->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue