summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-11-15 14:24:14 +0000
committerCarl Hetherington <carl@carlh.net>2011-11-15 14:24:14 +0000
commita7fd6e2925746ca08594e5ffcfaf416b08deee7b (patch)
tree3638e36c037d8a92ee7c57c39e26cd2ab300a53b
parent782c9383fc95533a358510292ad06267c66c5af4 (diff)
When tabbing between notes in a MIDI region view, only consider those that are being displayed according to the channel selector. Should avoid confusions such as that in #3976.
git-svn-id: svn://localhost/ardour2/branches/3.0@10614 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/midi_region_view.cc39
1 files changed, 26 insertions, 13 deletions
diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc
index 0f30c35733..9a6e5a498f 100644
--- a/gtk2_ardour/midi_region_view.cc
+++ b/gtk2_ardour/midi_region_view.cc
@@ -3281,24 +3281,30 @@ MidiRegionView::goto_next_note (bool add_to_selection)
time_sort_events ();
+ MidiTimeAxisView* const mtv = dynamic_cast<MidiTimeAxisView*>(&trackview);
+ uint16_t const channel_mask = mtv->channel_selector().get_selected_channels ();
+
for (Events::iterator i = _events.begin(); i != _events.end(); ++i) {
if ((*i)->selected()) {
use_next = true;
continue;
} else if (use_next) {
- if (!add_to_selection) {
- unique_select (*i);
- } else {
- note_selected (*i, true, false);
+ if (channel_mask & (1 << (*i)->note()->channel())) {
+ if (!add_to_selection) {
+ unique_select (*i);
+ } else {
+ note_selected (*i, true, false);
+ }
+ return;
}
- return;
}
}
/* use the first one */
- unique_select (_events.front());
-
+ if (!_event.empty() && (channel_mask & (1 << _events.front()->note()->channel ()))) {
+ unique_select (_events.front());
+ }
}
void
@@ -3312,23 +3318,30 @@ MidiRegionView::goto_previous_note (bool add_to_selection)
time_sort_events ();
+ MidiTimeAxisView* const mtv = dynamic_cast<MidiTimeAxisView*>(&trackview);
+ uint16_t const channel_mask = mtv->channel_selector().get_selected_channels ();
+
for (Events::reverse_iterator i = _events.rbegin(); i != _events.rend(); ++i) {
if ((*i)->selected()) {
use_next = true;
continue;
} else if (use_next) {
- if (!add_to_selection) {
- unique_select (*i);
- } else {
- note_selected (*i, true, false);
+ if (channel_mask & (1 << (*i)->note()->channel())) {
+ if (!add_to_selection) {
+ unique_select (*i);
+ } else {
+ note_selected (*i, true, false);
+ }
+ return;
}
- return;
}
}
/* use the last one */
- unique_select (*(_events.rbegin()));
+ if (!_events.empty() && (channel_mask & (1 << (*_events.rbegin())->note()->channel ()))) {
+ unique_select (*(_events.rbegin()));
+ }
}
void