diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2012-11-17 22:55:03 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2012-11-17 22:55:03 +0000 |
commit | 1bff57131a2b0a88f00dfb281db6f3d73c4e8b3b (patch) | |
tree | dab1bf09903a868b7bc73aae8e98f1d853606a5a /gtk2_ardour/automation_line.h | |
parent | 3b63eae41d949123f4845fe92c8e9d28bb36aa59 (diff) |
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
Diffstat (limited to 'gtk2_ardour/automation_line.h')
-rw-r--r-- | gtk2_ardour/automation_line.h | 27 |
1 files changed, 22 insertions, 5 deletions
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<ControlPoint*>, float, XMLNode *); - virtual std::pair<double, float> 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<ControlPoint*>, float, XMLNode *); + virtual std::pair<double, float> 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<ControlPoint*> control_points; /* visible control points */ + class ContiguousControlPoints : public std::list<ControlPoint*> { + 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<ContiguousControlPoints> CCP; + std::vector<CCP> contiguous_points; + void sync_model_with_view_point (ControlPoint&); void sync_model_with_view_points (std::list<ControlPoint*>); - void start_drag_common (double, float); + void start_drag_common (double, float); virtual void change_model (ARDOUR::AutomationList::iterator, double x, double y); |