Tweak/fix splash screen event-loop
[ardour.git] / gtk2_ardour / midi_streamview.cc
index 9258cf027d385973dd4080f64bcce0a4c881cc31..9e8014d4722002b5248f688390d16380aebf7cae 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"
@@ -47,7 +48,7 @@
 #include "ui_config.h"
 #include "utils.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace ARDOUR;
@@ -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);
                }
 
@@ -440,7 +453,7 @@ MidiStreamView::setup_rec_box ()
 
                if (!rec_active &&
                    _trackview.session()->record_status() == Session::Recording &&
-                   _trackview.track()->record_enabled()) {
+                   _trackview.track()->rec_enable_control()->get_value()) {
 
                        if (UIConfiguration::instance().get_show_waveforms_while_recording() && rec_regions.size() == rec_rects.size()) {
 
@@ -512,7 +525,7 @@ MidiStreamView::setup_rec_box ()
 
                } else if (rec_active &&
                           (_trackview.session()->record_status() != Session::Recording ||
-                           !_trackview.track()->record_enabled())) {
+                           !_trackview.track()->rec_enable_control()->get_value())) {
                        screen_update_connection.disconnect();
                        rec_active = false;
                        rec_updating = false;
@@ -610,7 +623,7 @@ MidiStreamView::update_rec_box ()
 
        /* Update the region being recorded to reflect where we currently are */
        boost::shared_ptr<ARDOUR::Region> region = rec_regions.back().first;
-       region->set_length (_trackview.track()->current_capture_end () - _trackview.track()->current_capture_start());
+       region->set_length (_trackview.track()->current_capture_end () - _trackview.track()->current_capture_start(), 0);
 
        MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (rec_regions.back().second);
        mrv->extend_active_notes ();
@@ -662,7 +675,7 @@ struct RegionPositionSorter {
 };
 
 bool
-MidiStreamView::paste (ARDOUR::framepos_t pos, const Selection& selection, PasteContext& ctx)
+MidiStreamView::paste (ARDOUR::framepos_t pos, const Selection& selection, PasteContext& ctx, const int32_t sub_num)
 {
        /* Paste into the first region which starts on or before pos.  Only called when
           using an internal editing tool. */
@@ -690,5 +703,5 @@ MidiStreamView::paste (ARDOUR::framepos_t pos, const Selection& selection, Paste
        }
 
        MidiRegionView* mrv = dynamic_cast<MidiRegionView*> (*prev);
-       return mrv ? mrv->paste(pos, selection, ctx) : false;
+       return mrv ? mrv->paste(pos, selection, ctx, sub_num) : false;
 }