13
0

use new parameter to limit minimum length of any range location

This commit is contained in:
Paul Davis 2014-12-16 13:03:09 -05:00
parent 94e2b61a86
commit 12803c4255

View File

@ -220,6 +220,11 @@ Location::set_start (framepos_t s, bool force, bool allow_bbt_recompute)
assert (_end >= 0); assert (_end >= 0);
return 0; return 0;
} else {
/* range locations must exceed a minimum duration */
if (_end - s < Config->get_range_location_minimum()) {
return -1;
}
} }
if (s != _start) { if (s != _start) {
@ -283,6 +288,11 @@ Location::set_end (framepos_t e, bool force, bool allow_bbt_recompute)
assert (_end >= 0); assert (_end >= 0);
return 0; return 0;
} else {
/* range locations must exceed a minimum duration */
if (e - _start < Config->get_range_location_minimum()) {
return -1;
}
} }
if (e != _end) { if (e != _end) {
@ -341,6 +351,11 @@ Location::set (framepos_t s, framepos_t e, bool allow_bbt_recompute)
} else { } else {
/* range locations must exceed a minimum duration */
if (e - s < Config->get_range_location_minimum()) {
return -1;
}
if (s != _start) { if (s != _start) {
framepos_t const old = _start; framepos_t const old = _start;