From eaf548f49f6d2aba07e5eb4af65516760836eea2 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 10 May 2012 21:40:10 +0000 Subject: [PATCH] don't trim regions in conjunction with xfade trimming unless auto-xfade and full-overlap-xfades are selected git-svn-id: svn://localhost/ardour2/branches/3.0@12245 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/audio_region_view.cc | 20 ++++++++++---------- libs/ardour/audioregion.cc | 11 +++++++---- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index edfd481636..165af74037 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -1583,18 +1583,18 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr ar, frame Points* points = get_canvas_points ("xfade edit redraw", npoints); boost::scoped_ptr 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 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 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 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 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 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])); } } diff --git a/libs/ardour/audioregion.cc b/libs/ardour/audioregion.cc index 36d5cf0a8c..066cf368f5 100644 --- a/libs/ardour/audioregion.cc +++ b/libs/ardour/audioregion.cc @@ -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.