From 5dd60c03dfe0cea802f674701dc2b5ea0737186c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 26 Oct 2022 16:57:06 -0600 Subject: [PATCH] automation lines: fix missing line segments --- gtk2_ardour/automation_line.cc | 8 ++++++-- gtk2_ardour/automation_line.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index 7c8b3eebf7..5af9e54673 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -92,6 +92,7 @@ AutomationLine::AutomationLine (const string& name, : trackview (tv) , _name (name) , _height (0) + , _view_index_offset (0) , alist (al) , _visible (Line) , terminal_points_can_slide (true) @@ -331,8 +332,8 @@ void AutomationLine::reset_line_coords (ControlPoint& cp) { if (cp.view_index() < line_points.size()) { - line_points[cp.view_index()].x = cp.get_x (); - line_points[cp.view_index()].y = cp.get_y (); + line_points[cp.view_index() + _view_index_offset].x = cp.get_x (); + line_points[cp.view_index() + _view_index_offset].y = cp.get_y (); } } @@ -1098,6 +1099,8 @@ AutomationLine::reset_callback (const Evoral::ControlList& events) std::cerr << "prec @ end ? " << (preceding == e.end()) << " foll @ end " << (following == e.end()) << std::endl; + _view_index_offset = 0; + if (control_points[0]->get_x() != 0 && preceding != e.end()) { double ty = model_to_view_coord_y (e.unlocked_eval (_offset)); @@ -1109,6 +1112,7 @@ AutomationLine::reset_callback (const Evoral::ControlList& events) line_points[n].y = _height - (ty * _height); line_points[n].x = 0; std::cerr << "Add initial point" << std::endl; + _view_index_offset = 1; ++n; } } diff --git a/gtk2_ardour/automation_line.h b/gtk2_ardour/automation_line.h index fba68d7985..4f2d60f5a1 100644 --- a/gtk2_ardour/automation_line.h +++ b/gtk2_ardour/automation_line.h @@ -171,7 +171,7 @@ protected: std::string _name; guint32 _height; uint32_t _line_color; - + uint32_t _view_index_offset; boost::shared_ptr alist; VisibleAspects _visible;