Minor copy-edit.
[ardour.git] / gtk2_ardour / control_point.cc
index d4821495072f44aab1c4b6c419aa272114b11c23..f40a809a4a1fe1a7fa860c080c36838b3f4bb269 100644 (file)
@@ -26,7 +26,6 @@
 #include "i18n.h"
 
 using namespace std;
-using namespace sigc;
 using namespace ARDOUR;
 using namespace PBD;
 using namespace Gnome; // for Canvas
@@ -46,7 +45,7 @@ ControlPoint::ControlPoint (AutomationLine& al)
        _item = new Canvas::SimpleRect (_line.canvas_group());
        _item->property_draw() = true;
        _item->property_fill() = false;
-       _item->property_fill_color_rgba() =  ARDOUR_UI::config()->canvasvar_ControlPointFill.get();
+       _item->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_ControlPointFill.get();
        _item->property_outline_color_rgba() = ARDOUR_UI::config()->canvasvar_ControlPointOutline.get();
        _item->property_outline_pixels() = 1;
        _item->set_data ("control_point", this);
@@ -112,6 +111,12 @@ ControlPoint::set_visible (bool yn)
        _item->property_draw() = (gboolean) yn;
 }
 
+bool
+ControlPoint::visible () const
+{
+       return _item->property_draw ();
+}
+
 void
 ControlPoint::reset (double x, double y, AutomationList::iterator mi, uint32_t vi, ShapeType shape)
 {
@@ -121,31 +126,14 @@ ControlPoint::reset (double x, double y, AutomationList::iterator mi, uint32_t v
 }
 
 void
-ControlPoint::show_color (bool entered, bool hide_too)
+ControlPoint::set_color ()
 {
        uint32_t color = 0;
 
-       if (entered) {
-               if (_selected) {
-                       color = ARDOUR_UI::config()->canvasvar_EnteredControlPointSelected.get();
-                       set_visible(true);
-               } else {
-                       color = ARDOUR_UI::config()->canvasvar_EnteredControlPointOutline.get();
-                       if (hide_too) {
-                               set_visible(false);
-                       }
-               }
-
+       if (_selected) {
+               color = ARDOUR_UI::config()->canvasvar_ControlPointSelected.get();
        } else {
-               if (_selected) {
-                       color = ARDOUR_UI::config()->canvasvar_ControlPointSelected.get();
-                       set_visible(true);
-               } else {
-                       color = ARDOUR_UI::config()->canvasvar_ControlPointOutline.get();
-                       if (hide_too) {
-                               set_visible(false);
-                       }
-               }
+               color = ARDOUR_UI::config()->canvasvar_ControlPointOutline.get();
        }
 
        _item->property_outline_color_rgba() = color;
@@ -156,15 +144,6 @@ void
 ControlPoint::set_size (double sz)
 {
        _size = sz;
-
-#if 0
-       if (_size > 6.0) {
-               item->property_fill() = (gboolean) TRUE;
-       } else {
-               item->property_fill() = (gboolean) FALSE;
-       }
-#endif
-
        move_to (_x, _y, _shape);
 }
 
@@ -200,3 +179,8 @@ ControlPoint::move_to (double x, double y, ShapeType shape)
        _shape = shape;
 }
 
+void
+ControlPoint::i2w (double& x, double& y) const
+{
+       _item->i2w (x, y);
+}