diff --git a/gtk2_ardour/midi_cue_editor.cc b/gtk2_ardour/midi_cue_editor.cc index e5608dff05..cd96609e46 100644 --- a/gtk2_ardour/midi_cue_editor.cc +++ b/gtk2_ardour/midi_cue_editor.cc @@ -269,6 +269,9 @@ MidiCueEditor::build_canvas () rubberband_rect->set_fill_color (UIConfiguration::instance().color_mod ("rubber band rect", "selection rect")); CANVAS_DEBUG_NAME (rubberband_rect, X_("cue rubberband rect")); + automation_group = new ArdourCanvas::Rectangle (hv_scroll_group); + CANVAS_DEBUG_NAME (automation_group, "cue automation group"); + prh = new ArdourCanvas::PianoRollHeader (v_scroll_group, *bg); double w, h; @@ -325,10 +328,17 @@ MidiCueEditor::canvas_allocate (Gtk::Allocation alloc) _visible_canvas_width = alloc.get_width(); _visible_canvas_height = alloc.get_height(); - bg->set_size (alloc.get_width(), alloc.get_height()); - if (view) { - view->set_height (alloc.get_height() - (n_timebars * timebar_height)); + double timebars = n_timebars * timebar_height; + double minus_timebars = alloc.get_height() - timebars; + double midi_view = ceil (minus_timebars * (2./3.)); + double auto_view = minus_timebars - midi_view; + + view->set_height (midi_view); + automation_group->set (ArdourCanvas::Rect (prh->width(), timebars + midi_view, ArdourCanvas::COORD_MAX, auto_view)); + bg->set_size (alloc.get_width(), midi_view); + } else { + bg->set_size (alloc.get_width(), alloc.get_height()); } } diff --git a/gtk2_ardour/midi_cue_editor.h b/gtk2_ardour/midi_cue_editor.h index 6ef448d6ac..571f6f5b0c 100644 --- a/gtk2_ardour/midi_cue_editor.h +++ b/gtk2_ardour/midi_cue_editor.h @@ -146,6 +146,7 @@ class MidiCueEditor : public CueEditor ArdourCanvas::Container* global_rect_group; ArdourCanvas::Container* no_scroll_group; ArdourCanvas::Container* data_group; + ArdourCanvas::Rectangle* automation_group; ArdourCanvas::Container* time_line_group; ArdourCanvas::Ruler* bbt_ruler; ArdourCanvas::Rectangle* tempo_bar; diff --git a/gtk2_ardour/midi_cue_view.cc b/gtk2_ardour/midi_cue_view.cc index 57c981653e..9944aa83fe 100644 --- a/gtk2_ardour/midi_cue_view.cc +++ b/gtk2_ardour/midi_cue_view.cc @@ -56,6 +56,7 @@ MidiCueView::MidiCueView (std::shared_ptr mt, event_rect->Event.connect (sigc::mem_fun (*this, &MidiCueView::canvas_event)); event_rect->set_fill (false); event_rect->set_outline (false); + CANVAS_DEBUG_NAME (event_rect, "cue event rect"); _note_group->raise_to_top ();