don't trim regions in conjunction with xfade trimming unless auto-xfade and full...
authorPaul Davis <paul@linuxaudiosystems.com>
Thu, 10 May 2012 21:40:10 +0000 (21:40 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Thu, 10 May 2012 21:40:10 +0000 (21:40 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@12245 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/audio_region_view.cc
libs/ardour/audioregion.cc

index edfd4816362070a29dd61ffc250ca744621b41fe..165af740377705c20a28b5d36c28d73c21e26368 100644 (file)
@@ -1583,18 +1583,18 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
 
        Points* points = get_canvas_points ("xfade edit redraw", npoints);
        boost::scoped_ptr<float> vec (new float[npoints]);
-       double effective_height = _height - NAME_HIGHLIGHT_SIZE;
+       double effective_height = _height - NAME_HIGHLIGHT_SIZE - 1.0;
 
        ar->fade_in()->curve().get_vector (0, ar->fade_in()->back()->when, vec.get(), npoints);
 
        for (int i = 0, pci = 0; i < npoints; ++i) {
                Gnome::Art::Point &p ((*points)[pci++]);
                p.set_x (i);
-               p.set_y (effective_height - (effective_height * vec.get()[i]));
+               p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
        }
 
        start_xfade_rect->property_x1() = ((*points)[0]).get_x();
-       start_xfade_rect->property_y1() = 0;
+       start_xfade_rect->property_y1() = 1.0;
        start_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
        start_xfade_rect->property_y2() = effective_height;
        start_xfade_rect->show ();
@@ -1613,7 +1613,7 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
                for (int i = 0, pci = 0; i < npoints; ++i) {
                        Gnome::Art::Point &p ((*points)[pci++]);
                        p.set_x (i);
-                       p.set_y (effective_height - (effective_height * (1.0 - vec.get()[i])));
+                       p.set_y (1.0 + effective_height - (effective_height * (1.0 - vec.get()[i])));
                }
 
        } else {
@@ -1623,7 +1623,7 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
                for (int i = 0, pci = 0; i < npoints; ++i) {
                        Gnome::Art::Point &p ((*points)[pci++]);
                        p.set_x (i);
-                       p.set_y (effective_height - (effective_height * vec.get()[i]));
+                       p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
                }
        }
 
@@ -1692,16 +1692,16 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn
        ar->fade_out()->curve().get_vector (0, ar->fade_out()->back()->when, vec.get(), npoints);
 
        double rend = trackview.editor().frame_to_pixel (_region->length() - len);
-       double effective_height = _height - NAME_HIGHLIGHT_SIZE;
+       double effective_height = _height - NAME_HIGHLIGHT_SIZE - 1;
 
        for (int i = 0, pci = 0; i < npoints; ++i) {
                Gnome::Art::Point &p ((*points)[pci++]);
                p.set_x (rend + i);
-               p.set_y (effective_height - (effective_height * vec.get()[i]));
+               p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
        }
 
        end_xfade_rect->property_x1() = ((*points)[0]).get_x();
-       end_xfade_rect->property_y1() = 0;
+       end_xfade_rect->property_y1() = 1;
        end_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
        end_xfade_rect->property_y2() = effective_height;
        end_xfade_rect->show ();
@@ -1720,7 +1720,7 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn
                for (int i = 0, pci = 0; i < npoints; ++i) {
                        Gnome::Art::Point &p ((*points)[pci++]);
                        p.set_x (rend + i);
-                       p.set_y (_height - (_height * (1.0 - vec.get()[i])));
+                       p.set_y (1.0 + effective_height - (effective_height * (1.0 - vec.get()[i])));
                }
 
        } else {
@@ -1730,7 +1730,7 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn
                for (int i = 0, pci = 0; i < npoints; ++i) {
                        Gnome::Art::Point &p ((*points)[pci++]);
                        p.set_x (rend + i);
-                       p.set_y (effective_height - (effective_height * vec.get()[i]));
+                       p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
                }
        }
 
index 36d5cf0a8c4211d3af3c78c542ab3882225ccdf1..066cf368f51ed16c2edbdbd161493f509bcaf922 100644 (file)
@@ -1149,7 +1149,9 @@ AudioRegion::set_fade_in_length (framecnt_t len)
                        _inverse_fade_in->extend_to (len);
                }
 
-               if (_fade_in_is_xfade) {
+               if (_session.config.get_xfade_model() == FullCrossfade &&
+                   _session.config.get_auto_xfade() && 
+                   _fade_in_is_xfade) {
 
                        /* trim a single other region below us to the new start
                           of the fade.
@@ -1161,7 +1163,6 @@ AudioRegion::set_fade_in_length (framecnt_t len)
                        }
                }
 
-
                _default_fade_in = false;
                send_change (PropertyChange (Properties::fade_in));
        }
@@ -1186,8 +1187,10 @@ AudioRegion::set_fade_out_length (framecnt_t len)
                        _inverse_fade_out->extend_to (len);
                }
                _default_fade_out = false;
-
-               if (_fade_out_is_xfade) {
+               
+               if (_session.config.get_xfade_model() == FullCrossfade &&
+                   _session.config.get_auto_xfade() && 
+                   _fade_out_is_xfade) {
 
                        /* trim a single other region below us to the new start
                           of the fade.