diff options
author | Robin Gareus <robin@gareus.org> | 2017-07-21 15:49:28 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-07-21 15:49:28 +0200 |
commit | 3d505636207b3a595ed8ae2f8c7309477d826638 (patch) | |
tree | 3afe4a53f963bf38f5a7a12f47c2e4ba01e491e4 | |
parent | 8400ebd175e0b2db632ea45b1943dc646dfe97c4 (diff) |
Properly propagate TAV TimeSelection
-rw-r--r-- | gtk2_ardour/automation_time_axis.cc | 13 | ||||
-rw-r--r-- | gtk2_ardour/automation_time_axis.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/midi_time_axis.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/time_axis_view.h | 1 |
5 files changed, 26 insertions, 0 deletions
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<AutomationLine> 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<TimeAxisView>); void add_child (boost::shared_ptr<TimeAxisView>); |