diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-12-31 13:28:20 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-12-31 13:28:20 -0500 |
commit | 68af0fdc0785e785c17a47537c320fbf28d53c72 (patch) | |
tree | 6ba43ccbfe7e56af2695d9e39c7ee1e5bcd205e7 /gtk2_ardour/automation_line.cc | |
parent | 87c29025def783379b433b944a498ecd582a8af1 (diff) |
fix up visibility control for automation lines
Diffstat (limited to 'gtk2_ardour/automation_line.cc')
-rw-r--r-- | gtk2_ardour/automation_line.cc | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index 831bdb00f9..eee0689c35 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -144,6 +144,11 @@ AutomationLine::show () } } else { line->hide(); + /* if the line is not visible, then no control points should be visible */ + for (vector<ControlPoint*>::iterator i = control_points.begin(); i != control_points.end(); ++i) { + (*i)->hide (); + } + return; } if (_visible & ControlPoints) { @@ -168,7 +173,11 @@ AutomationLine::show () void AutomationLine::hide () { - set_visibility (VisibleAspects (0)); + /* leave control points setting unchanged, we are just hiding the + overall line + */ + + set_visibility (AutomationLine::VisibleAspects (_visible & ~Line)); } double @@ -1068,22 +1077,34 @@ AutomationLine::set_list (boost::shared_ptr<ARDOUR::AutomationList> list) void AutomationLine::add_visibility (VisibleAspects va) { + VisibleAspects old = _visible; + _visible = VisibleAspects (_visible | va); - show (); + + if (old != _visible) { + show (); + } } void AutomationLine::set_visibility (VisibleAspects va) { - _visible = va; - show (); + if (_visible != va) { + _visible = va; + show (); + } } void AutomationLine::remove_visibility (VisibleAspects va) { + VisibleAspects old = _visible; + _visible = VisibleAspects (_visible & ~va); - show (); + + if (old != _visible) { + show (); + } } void |