#include <string>
#include <sys/types.h>
-#include <libgnomecanvasmm/line.h>
#include <sigc++/signal.h>
-#include "canvas.h"
-#include "simplerect.h"
#include "evoral/TimeConverter.hpp"
#include "ardour/automation_list.h"
#include "ardour/types.h"
+#include "canvas/types.h"
+#include "canvas/group.h"
+#include "canvas/curve.h"
+
class AutomationLine;
class ControlPoint;
class PointSelection;
class Selectable;
class Selection;
-namespace Gnome {
- namespace Canvas {
- class SimpleRect;
- }
-}
/** A GUI representation of an ARDOUR::AutomationList */
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 end_drag ();
+ 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, uint32_t& final_index);
+ virtual void end_drag (bool with_push, uint32_t final_index);
ControlPoint* nth (uint32_t);
ControlPoint const * nth (uint32_t) const;
bool _our_time_converter;
VisibleAspects _visible;
-
- bool _uses_gain_mapping : 1;
- bool terminal_points_can_slide : 1;
- bool update_pending : 1;
- bool no_draw : 1;
- bool _is_boolean : 1;
+
+ bool _uses_gain_mapping;
+ bool terminal_points_can_slide;
+ bool update_pending;
+ bool have_timeout;
+ bool no_draw;
+ bool _is_boolean;
/** true if we did a push at any point during the current drag */
bool did_push;
ArdourCanvas::Group& _parent_group;
ArdourCanvas::Group* group;
- ArdourCanvas::Line* line; /* line */
+ ArdourCanvas::Curve* line; /* line */
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);