13
0

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

View File

@ -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;

View File

@ -56,6 +56,7 @@ MidiCueView::MidiCueView (std::shared_ptr<ARDOUR::MidiTrack> 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 ();