for pianoroll MidiViews, set _visible_channel to the lowest MIDI channel with notes present

This commit is contained in:
Paul Davis 2025-03-08 18:27:20 -07:00
parent fd890b4891
commit 53ffd61dd9
2 changed files with 9 additions and 2 deletions

View file

@ -368,6 +368,15 @@ MidiView::set_model (std::shared_ptr<MidiModel> m)
//set_height (trackview.current_height());
if (_show_source) {
for (int n = 0; n < 16; ++n) {
if (_model->channels_present() & (1 << n)) {
set_visible_channel (n);
break;
}
}
}
_model->ContentsChanged.connect (connections_requiring_model, invalidator (*this), std::bind (&MidiView::model_changed, this), gui_context());
_midi_track->playback_filter().ChannelModeChanged.connect (connections_requiring_model, invalidator (*this),

View file

@ -2280,8 +2280,6 @@ Pianoroll::set_region (std::shared_ptr<ARDOUR::MidiRegion> r)
zoom_to_show (timecnt_t (timepos_t (max_extents_scale() * max_zoom_extent ().second.samples())));
}
set_visible_channel (0);
}
void