swallow all events in pianoroll automation group if there's no active automation

This commit is contained in:
Paul Davis
2026-01-12 12:46:14 -07:00
parent e381c29281
commit d16244d25e
2 changed files with 12 additions and 0 deletions

View File

@@ -104,6 +104,7 @@ PianorollMidiView::PianorollMidiView (std::shared_ptr<ARDOUR::MidiTrack> mt,
_note_group->raise_to_top (); _note_group->raise_to_top ();
automation_group = new ArdourCanvas::Rectangle (&parent); automation_group = new ArdourCanvas::Rectangle (&parent);
automation_group->Event.connect (sigc::mem_fun (*this, &PianorollMidiView::automation_group_event));
CANVAS_DEBUG_NAME (automation_group, "cue automation group"); CANVAS_DEBUG_NAME (automation_group, "cue automation group");
automation_group->set_fill_color (UIConfiguration::instance().color ("midi automation track fill")); automation_group->set_fill_color (UIConfiguration::instance().color ("midi automation track fill"));
automation_group->set_data ("linemerger", this); automation_group->set_data ("linemerger", this);
@@ -118,6 +119,16 @@ PianorollMidiView::~PianorollMidiView ()
delete velocity_display; delete velocity_display;
} }
bool
PianorollMidiView::automation_group_event (GdkEvent* ev)
{
if (!active_automation) {
/* Eat the event to prevent the parent seeing it */
return true;
}
return false;
}
bool bool
PianorollMidiView::midi_canvas_group_event (GdkEvent* ev) PianorollMidiView::midi_canvas_group_event (GdkEvent* ev)
{ {

View File

@@ -146,6 +146,7 @@ class PianorollMidiView : public MidiView
void unset_active_automation (); void unset_active_automation ();
bool midi_canvas_group_event (GdkEvent*); bool midi_canvas_group_event (GdkEvent*);
bool automation_group_event (GdkEvent*);
Gtkmm2ext::Color line_color_for (Evoral::Parameter const &); Gtkmm2ext::Color line_color_for (Evoral::Parameter const &);
void reset_width_dependent_items (double pixel_width); void reset_width_dependent_items (double pixel_width);