From 3d505636207b3a595ed8ae2f8c7309477d826638 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 21 Jul 2017 15:49:28 +0200 Subject: Properly propagate TAV TimeSelection --- gtk2_ardour/automation_time_axis.cc | 13 +++++++++++++ gtk2_ardour/automation_time_axis.h | 2 ++ gtk2_ardour/midi_time_axis.cc | 4 ++++ gtk2_ardour/time_axis_view.cc | 6 ++++++ gtk2_ardour/time_axis_view.h | 1 + 5 files changed, 26 insertions(+) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index 39a312da4b..724809d446 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -889,6 +889,19 @@ AutomationTimeAxisView::add_line (boost::shared_ptr line) line->add_visibility (AutomationLine::Line); } +bool +AutomationTimeAxisView::propagate_time_selection () const +{ + /* MIDI automation is part of the MIDI region. It is always + * implicily selected with the parent, regardless of TAV selection + */ + if (_parameter.type() >= MidiCCAutomation && + _parameter.type() <= MidiChannelPressureAutomation) { + return true; + } + return false; +} + void AutomationTimeAxisView::entered() { diff --git a/gtk2_ardour/automation_time_axis.h b/gtk2_ardour/automation_time_axis.h index 573d88a4d5..84d2d528c3 100644 --- a/gtk2_ardour/automation_time_axis.h +++ b/gtk2_ardour/automation_time_axis.h @@ -189,6 +189,8 @@ protected: bool ignore_state_request; bool ignore_mode_request; + bool propagate_time_selection () const; + void automation_state_changed (); void set_interpolation (ARDOUR::AutomationList::InterpolationStyle); diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 7bd7141c4e..ffff6a9698 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -1324,6 +1324,10 @@ MidiTimeAxisView::create_automation_child (const Evoral::Parameter& param, bool } add_automation_child (param, track, show); + if (selected ()) { + reshow_selection (_editor.get_selection().time); + } + break; case PanWidthAutomation: diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 58c9d44bc5..b03a0c03bd 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -822,6 +822,9 @@ TimeAxisView::show_selection (TimeSelection& ts) for (Children::iterator i = children.begin(); i != children.end(); ++i) { + if (!(*i)->selected () && !(*i)->propagate_time_selection ()) { + continue; + } (*i)->show_selection (ts); } @@ -879,6 +882,9 @@ TimeAxisView::reshow_selection (TimeSelection& ts) show_selection (ts); for (Children::iterator i = children.begin(); i != children.end(); ++i) { + if (!(*i)->selected () && !(*i)->propagate_time_selection ()) { + continue; + } (*i)->show_selection (ts); } } diff --git a/gtk2_ardour/time_axis_view.h b/gtk2_ardour/time_axis_view.h index 0b3c6ea722..ac67169a7e 100644 --- a/gtk2_ardour/time_axis_view.h +++ b/gtk2_ardour/time_axis_view.h @@ -289,6 +289,7 @@ class TimeAxisView : public virtual AxisView Children children; bool is_child (TimeAxisView*); + virtual bool propagate_time_selection () const { return false; } virtual void remove_child (boost::shared_ptr); void add_child (boost::shared_ptr); -- cgit v1.2.3