summaryrefslogtreecommitdiff
path: root/gtk2_ardour/diamond.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-10-06 22:07:10 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-10-06 22:07:10 +0000
commitaefcce1c99598cc8c1748940a01e2d8aa55caf85 (patch)
tree9a6b0a3be7faac2c82b58f3517640fa195c96825 /gtk2_ardour/diamond.cc
parent77364b0e25bcf97d0f3000ee97c27b2dca8454c6 (diff)
ogg/flac support bits and pieces; fix up MIDI note dragging and front-edge trims; BROKEN IN PERCUSSIVE MODE FOR NOW
git-svn-id: svn://localhost/ardour2/branches/3.0@5745 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/diamond.cc')
-rw-r--r--gtk2_ardour/diamond.cc32
1 files changed, 25 insertions, 7 deletions
diff --git a/gtk2_ardour/diamond.cc b/gtk2_ardour/diamond.cc
index 7d3e66357d..3cc198fb98 100644
--- a/gtk2_ardour/diamond.cc
+++ b/gtk2_ardour/diamond.cc
@@ -25,17 +25,35 @@ using namespace Gnome::Art;
Diamond::Diamond(Group& group, double height)
: Polygon(group)
{
- set_height(height);
+ points = gnome_canvas_points_new (4);
+ g_object_set (gobj(), "points", points, NULL);
+ set_height (height);
+}
+
+Diamond::~Diamond ()
+{
+ gnome_canvas_points_free (points);
}
void
Diamond::set_height(double height)
{
- Points points;
- points.push_back(Art::Point(0, height*2.0));
- points.push_back(Art::Point(height, height));
- points.push_back(Art::Point(0, 0));
- points.push_back(Art::Point(-height, height));
- property_points() = points;
+ double x1, y1, x2, y2;
+
+ get_bounds (x1, y1, x2, y2);
+
+ points->coords[0] = x1;
+ points->coords[1] = y1 + height*2.0;
+
+ points->coords[2] = x2 + height;
+ points->coords[3] = y1 + height;
+
+ points->coords[4] = x1;
+ points->coords[5] = y2;
+
+ points->coords[6] = x2 -height;
+ points->coords[7] = y2 + height;
+
+ g_object_set (gobj(), "points", points, NULL);
}