From 64b08a1c7024628ba9391285862418f572bd42d8 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 28 Jun 2023 13:40:49 -0600 Subject: [PATCH] when a parent (audio/MIDI) regionview is selected, raise matching AutomationRegionView Currently, we only use AutomationRegionView to show MIDI CC data --- gtk2_ardour/automation_region_view.cc | 11 +++++++++++ gtk2_ardour/automation_region_view.h | 2 ++ gtk2_ardour/region_view.h | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/automation_region_view.cc b/gtk2_ardour/automation_region_view.cc index 85df1bdf1c..3d8605f1da 100644 --- a/gtk2_ardour/automation_region_view.cc +++ b/gtk2_ardour/automation_region_view.cc @@ -342,3 +342,14 @@ AutomationRegionView::exited () _line->track_exited(); } } +void +AutomationRegionView::set_selected (bool yn) +{ + /* don't call RegionView::set_selected() because for automation + * regionviews, we don't use visual "clues" to indicate selection. + */ + + if (yn && _parameter.type() == ARDOUR::MidiCCAutomation) { + group->raise_to_top (); + } +} diff --git a/gtk2_ardour/automation_region_view.h b/gtk2_ardour/automation_region_view.h index a76bcce596..a357337b8d 100644 --- a/gtk2_ardour/automation_region_view.h +++ b/gtk2_ardour/automation_region_view.h @@ -50,6 +50,8 @@ public: void init (bool wfd); + void set_selected (bool yn); + bool paste (Temporal::timepos_t const & pos, unsigned paste_count, float times, diff --git a/gtk2_ardour/region_view.h b/gtk2_ardour/region_view.h index 6a71845d03..23321dc2ea 100644 --- a/gtk2_ardour/region_view.h +++ b/gtk2_ardour/region_view.h @@ -66,7 +66,7 @@ public: ~RegionView (); - void set_selected (bool yn); + virtual void set_selected (bool yn); virtual void init (bool what_changed);