From 1bff57131a2b0a88f00dfb281db6f3d73c4e8b3b Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 17 Nov 2012 22:55:03 +0000 Subject: substantive change to automation line dragging code to avoid O(N^4) behaviour. performance fixes are still required for realistically data-rich automation lines git-svn-id: svn://localhost/ardour2/branches/3.0@13515 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/automation_line.h | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'gtk2_ardour/automation_line.h') diff --git a/gtk2_ardour/automation_line.h b/gtk2_ardour/automation_line.h index 73734bcd40..16a410a2fc 100644 --- a/gtk2_ardour/automation_line.h +++ b/gtk2_ardour/automation_line.h @@ -80,10 +80,10 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulDestructible bool control_points_adjacent (double xval, uint32_t& before, uint32_t& after); /* dragging API */ - virtual void start_drag_single (ControlPoint*, double, float); - virtual void start_drag_line (uint32_t, uint32_t, float); - virtual void start_drag_multiple (std::list, float, XMLNode *); - virtual std::pair drag_motion (double, float, bool, bool); + virtual void start_drag_single (ControlPoint*, double, float); + virtual void start_drag_line (uint32_t, uint32_t, float); + virtual void start_drag_multiple (std::list, float, XMLNode *); + virtual std::pair drag_motion (double, float, bool, bool with_push); virtual void end_drag (); ControlPoint* nth (uint32_t); @@ -182,9 +182,26 @@ class AutomationLine : public sigc::trackable, public PBD::StatefulDestructible ArdourCanvas::Points line_points; /* coordinates for canvas line */ std::vector control_points; /* visible control points */ + class ContiguousControlPoints : public std::list { + public: + ContiguousControlPoints (AutomationLine& al); + double clamp_dx (double dx); + void move (double dx, double dy); + void compute_x_bounds (); + private: + AutomationLine& line; + double before_x; + double after_x; + }; + + friend class ContiguousControlPoints; + + typedef boost::shared_ptr CCP; + std::vector contiguous_points; + void sync_model_with_view_point (ControlPoint&); void sync_model_with_view_points (std::list); - void start_drag_common (double, float); + void start_drag_common (double, float); virtual void change_model (ARDOUR::AutomationList::iterator, double x, double y); -- cgit v1.2.3