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 | |
parent | 87c29025def783379b433b944a498ecd582a8af1 (diff) |
fix up visibility control for automation lines
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/audio_region_view.cc | 5 | ||||
-rw-r--r-- | gtk2_ardour/automation_line.cc | 31 | ||||
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 8 |
3 files changed, 29 insertions, 15 deletions
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index af6da5a3c0..6bf76c84e8 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -1323,7 +1323,8 @@ AudioRegionView::entered (bool internal_editing) trackview.editor().set_current_trimmable (_region); trackview.editor().set_current_movable (_region); - if (gain_line && trackview.editor().current_mouse_mode() == Editing::MouseGain) { + if (gain_line) { + /* these may or may not be visible depending on mouse mode */ gain_line->add_visibility (AutomationLine::ControlPoints); } @@ -1341,7 +1342,7 @@ AudioRegionView::exited () trackview.editor().set_current_trimmable (boost::shared_ptr<Trimmable>()); trackview.editor().set_current_movable (boost::shared_ptr<Movable>()); - if (gain_line && trackview.editor().current_mouse_mode() == Editing::MouseGain) { + if (gain_line) { gain_line->remove_visibility (AutomationLine::ControlPoints); } 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 diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 4f1410299d..e6772e42b2 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -2043,7 +2043,6 @@ bool Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent*, ItemType item_type) { AutomationLine* al; - ControlPoint* cp; Marker *marker; Location *loc; RegionView* rv; @@ -2052,13 +2051,6 @@ Editor::leave_handler (ArdourCanvas::Item* item, GdkEvent*, ItemType item_type) switch (item_type) { case ControlPointItem: - cp = reinterpret_cast<ControlPoint*>(item->get_data ("control_point")); - if (cp->line().the_list()->interpolation() != AutomationList::Discrete) { - if (cp->line().npoints() > 1 && !cp->get_selected()) { - cp->hide (); - } - } - if (is_drawable()) { set_canvas_cursor (current_canvas_cursor); } |