add a new automation group rect to the midi cue editor, and size it

This commit is contained in:
Paul Davis 2024-08-25 13:07:06 -06:00
parent 45e4b97a6f
commit 12519ef621
3 changed files with 15 additions and 3 deletions

View file

@ -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());
}
}