summaryrefslogtreecommitdiff
path: root/gtk2_ardour/control_point.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-01-03 00:08:58 +0000
committerCarl Hetherington <carl@carlh.net>2010-01-03 00:08:58 +0000
commit0f79f67398fcf319e9471e9b2b3b91e2ea6b2fee (patch)
tree7faedc8d87a8a4195be2d4878a4dc2abb54ab487 /gtk2_ardour/control_point.cc
parentc88716665a62399efa6278b5eaa254434a77a305 (diff)
Some cleanups to drawing of automation line control points. Drag all selected automation points if one selected point is dragged.
git-svn-id: svn://localhost/ardour2/branches/3.0@6437 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/control_point.cc')
-rw-r--r--gtk2_ardour/control_point.cc38
1 files changed, 16 insertions, 22 deletions
diff --git a/gtk2_ardour/control_point.cc b/gtk2_ardour/control_point.cc
index 781f9f3b31..f40a809a4a 100644
--- a/gtk2_ardour/control_point.cc
+++ b/gtk2_ardour/control_point.cc
@@ -45,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);
@@ -111,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)
{
@@ -120,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;
@@ -190,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);
+}