summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-10-31 15:39:29 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-10-31 15:39:29 -0400
commitba26316857ddb70bd34f2c14d05932c8729c9d84 (patch)
tree82115b4c24d97dc8fb4f1ce02f4bceb0d225858a /gtk2_ardour
parentea1ccb869a152d7344f498d2a062867f5bcf9d0b (diff)
make region fade in/out curve shapes into PolyLines not Polygons so that they don't close the stroke path at the top/bottom
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/audio_region_view.cc58
-rw-r--r--gtk2_ardour/audio_region_view.h6
2 files changed, 11 insertions, 53 deletions
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc
index 55f5a3f3af..7d45e8c262 100644
--- a/gtk2_ardour/audio_region_view.cc
+++ b/gtk2_ardour/audio_region_view.cc
@@ -159,14 +159,14 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
create_waves ();
- fade_in_shape = new ArdourCanvas::Polygon (group);
+ fade_in_shape = new ArdourCanvas::PolyLine (group);
CANVAS_DEBUG_NAME (fade_in_shape, string_compose ("fade in shape for %1", region()->name()));
- fade_in_shape->set_fill_color (fade_color);
+ fade_in_shape->set_outline_color (fade_color);
fade_in_shape->set_data ("regionview", this);
- fade_out_shape = new ArdourCanvas::Polygon (group);
+ fade_out_shape = new ArdourCanvas::PolyLine (group);
CANVAS_DEBUG_NAME (fade_out_shape, string_compose ("fade out shape for %1", region()->name()));
- fade_out_shape->set_fill_color (fade_color);
+ fade_out_shape->set_outline_color (fade_color);
fade_out_shape->set_data ("regionview", this);
if (!_recregion) {
@@ -315,10 +315,10 @@ AudioRegionView::fade_in_active_changed ()
{
if (audio_region()->fade_in_active()) {
/* XXX: make a themable colour */
- fade_in_shape->set_fill_color (RGBA_TO_UINT (45, 45, 45, 90));
+ fade_in_shape->set_outline_color (RGBA_TO_UINT (45, 45, 45, 90));
} else {
/* XXX: make a themable colour */
- fade_in_shape->set_fill_color (RGBA_TO_UINT (45, 45, 45, 20));
+ fade_in_shape->set_outline_color (RGBA_TO_UINT (45, 45, 45, 20));
}
}
@@ -327,10 +327,10 @@ AudioRegionView::fade_out_active_changed ()
{
if (audio_region()->fade_out_active()) {
/* XXX: make a themable colour */
- fade_out_shape->set_fill_color (RGBA_TO_UINT (45, 45, 45, 90));
+ fade_out_shape->set_outline_color (RGBA_TO_UINT (45, 45, 45, 90));
} else {
/* XXX: make a themable colour */
- fade_out_shape->set_fill_color (RGBA_TO_UINT (45, 45, 45, 20));
+ fade_out_shape->set_outline_color (RGBA_TO_UINT (45, 45, 45, 20));
}
}
@@ -584,26 +584,6 @@ AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, f
redraw_start_xfade_to (ar, width, points, effective_height);
- /* add 3 more points */
-
- points.push_back (Duple());
- points.push_back (Duple());
- points.push_back (Duple());
-
- /* fold back */
-
- points[pi].x = pwidth;
- points[pi].y = 2;
- pi++;
-
- points[pi].x = 1;
- points[pi].y = 2;
- pi++;
-
- /* connect the dots ... */
-
- points[pi] = points[0];
-
fade_in_shape->set (points);
/* ensure trim handle stays on top */
@@ -682,28 +662,6 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar,
redraw_end_xfade_to (ar, width, points, effective_height);
- /* fill the polygon*/
-
- /* add 3 more points */
-
- points.push_back (Duple());
- points.push_back (Duple());
- points.push_back (Duple());
-
- /* fold back */
-
- points[pi].x = _pixel_width;
- points[pi].y = effective_height;
- pi++;
-
- points[pi].x = _pixel_width;
- points[pi].y = 2;
- pi++;
-
- /* connect the dots ... */
-
- points[pi] = points[0];
-
fade_out_shape->set (points);
/* ensure trim handle stays on top */
diff --git a/gtk2_ardour/audio_region_view.h b/gtk2_ardour/audio_region_view.h
index 353d0dc937..bb5cbf29c4 100644
--- a/gtk2_ardour/audio_region_view.h
+++ b/gtk2_ardour/audio_region_view.h
@@ -150,9 +150,9 @@ class AudioRegionView : public RegionView
std::list<std::pair<framepos_t, ArdourCanvas::Line*> > feature_lines;
- ArdourCanvas::Polygon* sync_mark; ///< polgyon for sync position
- ArdourCanvas::Polygon* fade_in_shape;
- ArdourCanvas::Polygon* fade_out_shape;
+ ArdourCanvas::Polygon* sync_mark; ///< polgyon for sync position
+ ArdourCanvas::PolyLine* fade_in_shape;
+ ArdourCanvas::PolyLine* fade_out_shape;
ArdourCanvas::Rectangle* fade_in_handle; ///< fade in handle, or 0
ArdourCanvas::Rectangle* fade_out_handle; ///< fade out handle, or 0