From ea3918ba2d72984334e97e1d2af5d1717d23b2ea Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sun, 1 Jun 2014 00:40:07 +0200 Subject: [PATCH] disable snap fades to 'other' region (for now) --- gtk2_ardour/editor_drag.cc | 10 ++++++---- gtk2_ardour/editor_drag.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 7fee5d25ac..93fafdfcf1 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -2015,8 +2015,9 @@ TrimDrag::motion (GdkEvent* event, bool first_move) boost::shared_ptr ar (arv->audio_region()); framecnt_t len = ar->fade_in()->back()->when; framecnt_t diff = ar->first_frame() - i->initial_position; - double new_length = len - diff; - i->anchored_fade_length = ar->verify_xfade_bounds (new_length, true /*START*/ ); + framepos_t new_length = len - diff; + i->anchored_fade_length = min (ar->length(), new_length); + //i->anchored_fade_length = ar->verify_xfade_bounds (new_length, true /*START*/ ); arv->reset_fade_in_shape_width (ar, i->anchored_fade_length, true); } } @@ -2032,8 +2033,9 @@ TrimDrag::motion (GdkEvent* event, bool first_move) boost::shared_ptr ar (arv->audio_region()); framecnt_t len = ar->fade_out()->back()->when; framecnt_t diff = 1 + ar->last_frame() - i->initial_end; - double new_length = len + diff; - i->anchored_fade_length = ar->verify_xfade_bounds (new_length, false /*END*/ ); + framepos_t new_length = len + diff; + i->anchored_fade_length = min (ar->length(), new_length); + //i->anchored_fade_length = ar->verify_xfade_bounds (new_length, false /*END*/ ); arv->reset_fade_out_shape_width (ar, i->anchored_fade_length, true); } } diff --git a/gtk2_ardour/editor_drag.h b/gtk2_ardour/editor_drag.h index b67c7ae5f6..259dc50778 100644 --- a/gtk2_ardour/editor_drag.h +++ b/gtk2_ardour/editor_drag.h @@ -261,7 +261,7 @@ public: double initial_y; ///< the initial y position of the view before any reparenting framepos_t initial_position; ///< initial position of the region framepos_t initial_end; ///< initial end position of the region - double anchored_fade_length; ///< fade_length when anchored during drag + framepos_t anchored_fade_length; ///< fade_length when anchored during drag boost::shared_ptr initial_playlist; };