refactor level-meter widget: 5x2 stops meter colors
[ardour.git] / gtk2_ardour / control_point.cc
index 7632642adc32ce80be91e7ff1bf04116c48a86c9..d869e094aad16ffc3fd52494b35244165d97814c 100644 (file)
@@ -30,6 +30,8 @@ using namespace ARDOUR;
 using namespace PBD;
 using namespace Gnome; // for Canvas
 
+PBD::Signal1<void, ControlPoint *> ControlPoint::CatchDeletion;
+
 ControlPoint::ControlPoint (AutomationLine& al)
        : _line (al)
 {
@@ -82,6 +84,8 @@ ControlPoint::ControlPoint (const ControlPoint& other, bool /*dummy_arg_to_force
 
 ControlPoint::~ControlPoint ()
 {
+       CatchDeletion (this); /* EMIT SIGNAL */
+       
        delete _item;
 }
 
@@ -118,6 +122,14 @@ ControlPoint::visible () const
 void
 ControlPoint::reset (double x, double y, AutomationList::iterator mi, uint32_t vi, ShapeType shape)
 {
+       /* If this is too big, libart will confuse itself and segfault after it casts the bounding box
+          of this automation line to ints.  Sigh.
+       */
+
+       if (x > INT32_MAX) {
+               x = INT32_MAX;
+       }
+
        _model = mi;
        _view_index = vi;
        move_to (x, y, shape);