+ // Add and display region views, and flag them as valid
+ _trackview.get_diskstream()->playlist()->foreach_region(
+ sigc::hide_return (sigc::mem_fun (*this, &StreamView::add_region_view))
+ );
+
+ // Stack regions by layer, and remove invalid regions
+ layer_regions();
+
+ // Update note range (not regions which are correct) and draw note lines
+ apply_note_range(_lowest_note, _highest_note, false);
+}
+
+
+void
+MidiStreamView::update_contents_height ()
+{
+ StreamView::update_contents_height();
+ _note_lines->property_y2() = height;
+ draw_note_lines();
+}
+
+void
+MidiStreamView::draw_note_lines()
+{
+ double y;
+ double prev_y = contents_height();
+ uint32_t color;
+
+ _note_lines->clear();
+
+ for (int i = lowest_note(); i <= highest_note(); ++i) {
+ y = floor(note_to_y(i));
+
+ _note_lines->add_line(prev_y, 1.0, ARDOUR_UI::config()->canvasvar_PianoRollBlackOutline.get());
+
+ switch (i % 12) {
+ case 1:
+ case 3:
+ case 6:
+ case 8:
+ case 10:
+ color = ARDOUR_UI::config()->canvasvar_PianoRollBlack.get();
+ break;
+ default:
+ color = ARDOUR_UI::config()->canvasvar_PianoRollWhite.get();
+ break;
+ }