make region fade in/out curve shapes into PolyLines not Polygons so that they don...
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 31 Oct 2013 19:39:29 +0000 (15:39 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 31 Oct 2013 19:39:29 +0000 (15:39 -0400)
gtk2_ardour/audio_region_view.cc
gtk2_ardour/audio_region_view.h

index 55f5a3f3af021d727a9a2a8e60443dc57078db6b..7d45e8c262840dd55281ec5539cf9db381e18299 100644 (file)
@@ -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 */
index 353d0dc93777aeccf0b58d2c123df5b81dfc622b..bb5cbf29c4be3f7b8e122639841eb36ad1534ab9 100644 (file)
@@ -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