+
+ // Extend visible range to show newly recorded data, if necessary
+ _lowest_note = std::min(_lowest_note, _data_note_min);
+ _highest_note = std::max(_highest_note, _data_note_max);
+
+ veto_note_range(_lowest_note, _highest_note);
+
+ // Flag region views as invalid and disable drawing
+ for (i = region_views.begin(); i != region_views.end(); ++i) {
+ (*i)->set_valid(false);
+ (*i)->enable_display(false);
+ }
+
+ // Add and display region views, and flag them as valid
+ _trackview.track()->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() = child_height ();
+
+ apply_note_range (lowest_note(), highest_note(), true);
+}
+
+void
+MidiStreamView::draw_note_lines()
+{
+ if (!_note_lines) {
+ return;
+ }
+
+ double y;
+ double prev_y = contents_height();
+ uint32_t color;
+
+ _note_lines->clear();