From c8303c8b7ee25e453f3374e37c022ccc0c16a3f1 Mon Sep 17 00:00:00 2001 From: nick_m Date: Sat, 16 May 2015 04:50:37 +1000 Subject: [PATCH] Revert incorrect region_length() definition. --- gtk2_ardour/editor_drag.cc | 2 +- libs/ardour/ardour/region.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index b2f84fe638..799d441b16 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -2800,7 +2800,7 @@ TrimDrag::motion (GdkEvent* event, bool first_move) if (arv) { boost::shared_ptr ar (arv->audio_region()); framecnt_t len = ar->fade_out()->back()->when; - framecnt_t diff = ar->last_frame() - i->initial_end; + framecnt_t diff = 1 + ar->last_frame() - i->initial_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*/ ); diff --git a/libs/ardour/ardour/region.h b/libs/ardour/ardour/region.h index 071cae9127..54cfd57fea 100644 --- a/libs/ardour/ardour/region.h +++ b/libs/ardour/ardour/region.h @@ -139,7 +139,7 @@ class LIBARDOUR_API Region /* first_frame() is an alias; last_frame() just hides some math */ framepos_t first_frame () const { return _position; } - framepos_t last_frame () const { return _position + _length; } + framepos_t last_frame () const { return _position + _length - 1; } /** Return the earliest possible value of _position given the * value of _start within the region's sources @@ -151,7 +151,7 @@ class LIBARDOUR_API Region framepos_t latest_possible_frame () const; Evoral::Range last_range () const { - return Evoral::Range (_last_position, _last_position + _last_length); + return Evoral::Range (_last_position, _last_position + _last_length - 1); } Evoral::Range range () const {