Lua may call C++ functions with throw. Catch them
[ardour.git] / gtk2_ardour / midi_streamview.cc
index 301e9ddcb401f51eb959ccc6f9008eed3d0bff89..d3a316194df53ddec4c8522b63ac0deabc1a8990 100644 (file)
@@ -33,6 +33,7 @@
 #include "ardour/region_factory.h"
 #include "ardour/session.h"
 #include "ardour/smf_source.h"
+#include "ardour/evoral_types_convert.h"
 
 #include "gui_thread.h"
 #include "midi_region_view.h"
@@ -242,6 +243,18 @@ MidiStreamView::update_data_note_range(uint8_t min, uint8_t max)
        return dirty;
 }
 
+void
+MidiStreamView::set_layer_display (LayerDisplay d)
+{
+
+//revert this change for now.  Although stacked view is weirdly implemented wrt the "scroomer", it is still necessary to manage layered midi regions.
+//     if (d != Overlaid) {
+//             return;
+//     }
+
+       StreamView::set_layer_display (d);
+}
+
 void
 MidiStreamView::redisplay_track ()
 {
@@ -346,7 +359,7 @@ MidiStreamView::draw_note_lines()
                double h = y - prev_y;
                double mid = y + (h/2.0);
 
-               if (height > 1.0) { // XXX ? should that not be h >= 1 ?
+               if (mid >= 0 && h > 1.0) {
                        _note_lines->add (mid, h, color);
                }
 
@@ -436,7 +449,7 @@ MidiStreamView::setup_rec_box ()
 {
        // cerr << _trackview.name() << " streamview SRB\n";
 
-       if (_trackview.session()->transport_rolling()) {
+       if (!_trackview.session()->transport_stopped()) {
 
                if (!rec_active &&
                    _trackview.session()->record_status() == Session::Recording &&