From 47db75b0d66c0dd298112d53c427eba85567cae8 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 11 Nov 2024 21:49:55 -0700 Subject: [PATCH] cleanup some aspects of midicue editor playhead behavior --- gtk2_ardour/midi_cue_editor.cc | 9 +++------ gtk2_ardour/midi_cue_view.cc | 3 ++- gtk2_ardour/midi_cue_view.h | 1 + 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/gtk2_ardour/midi_cue_editor.cc b/gtk2_ardour/midi_cue_editor.cc index 73bfdc354e..624cb9bc5e 100644 --- a/gtk2_ardour/midi_cue_editor.cc +++ b/gtk2_ardour/midi_cue_editor.cc @@ -268,7 +268,7 @@ MidiCueEditor::build_canvas () prh = new ArdourCanvas::PianoRollHeader (v_scroll_group, *bg); - view = new MidiCueView (nullptr, 0, *data_group, *this, *bg, 0xff0000ff); + view = new MidiCueView (nullptr, 0, *data_group, *no_scroll_group, *this, *bg, 0xff0000ff); bg->set_view (view); prh->set_view (view); @@ -282,6 +282,7 @@ MidiCueEditor::build_canvas () prh->set_position (Duple (0., n_timebars * timebar_height)); data_group->set_position (ArdourCanvas::Duple (_timeline_origin, timebar_height * n_timebars)); + no_scroll_group->set_position (ArdourCanvas::Duple (_timeline_origin, timebar_height * n_timebars)); cursor_scroll_group->set_position (ArdourCanvas::Duple (_timeline_origin, timebar_height * n_timebars)); h_scroll_group->set_position (Duple (_timeline_origin, 0.)); @@ -292,6 +293,7 @@ MidiCueEditor::build_canvas () _playhead_cursor->set_sensitive (UIConfiguration::instance().get_sensitize_playhead()); _playhead_cursor->set_color (UIConfiguration::instance().color ("play head")); _playhead_cursor->canvas_item().raise_to_top(); + h_scroll_group->raise_to_top (); _canvas->set_name ("MidiCueCanvas"); _canvas->add_events (Gdk::POINTER_MOTION_HINT_MASK | Gdk::SCROLL_MASK | Gdk::KEY_PRESS_MASK | Gdk::KEY_RELEASE_MASK); @@ -317,11 +319,6 @@ MidiCueEditor::maybe_update () return; } - if (_track->rec_enable_control()->get_value()) { - /* ::data_captured() will handle it */ - return; - } - ARDOUR::TriggerPtr trigger = _track->triggerbox()->currently_playing (); if (!trigger) { diff --git a/gtk2_ardour/midi_cue_view.cc b/gtk2_ardour/midi_cue_view.cc index 5669e3ede4..5c2d9de67a 100644 --- a/gtk2_ardour/midi_cue_view.cc +++ b/gtk2_ardour/midi_cue_view.cc @@ -48,6 +48,7 @@ using namespace Gtkmm2ext; MidiCueView::MidiCueView (std::shared_ptr mt, uint32_t slot_index, ArdourCanvas::Item& parent, + ArdourCanvas::Item& noscroll_parent, EditingContext& ec, MidiViewBackground& bg, uint32_t basic_color) @@ -79,7 +80,7 @@ MidiCueView::MidiCueView (std::shared_ptr mt, automation_group->set_fill_color (UIConfiguration::instance().color ("midi automation track fill")); automation_group->set_data ("linemerger", this); - button_bar = new ArdourCanvas::Box (&parent, ArdourCanvas::Box::Horizontal); + button_bar = new ArdourCanvas::Box (&noscroll_parent, ArdourCanvas::Box::Horizontal); CANVAS_DEBUG_NAME (button_bar, "button bar"); button_bar->set_spacing (12.); /* Right-side padding only */ diff --git a/gtk2_ardour/midi_cue_view.h b/gtk2_ardour/midi_cue_view.h index 05c15d0237..77ac1f8bc6 100644 --- a/gtk2_ardour/midi_cue_view.h +++ b/gtk2_ardour/midi_cue_view.h @@ -44,6 +44,7 @@ class MidiCueView : public MidiView MidiCueView (std::shared_ptr mt, uint32_t slot_index, ArdourCanvas::Item& parent, + ArdourCanvas::Item& noscroll_parent, EditingContext& ec, MidiViewBackground& bg, uint32_t basic_color