From a6b3c4048e76369ec2e12c315dac91ad713444c7 Mon Sep 17 00:00:00 2001 From: nick_m Date: Sun, 9 Oct 2016 23:40:54 +1100 Subject: Ensure midi region start trim always sets _start_beats. - Property::set() requires that new_val != current for a change to occur, but Beats::operator!= has tick resolution. i think this is pretty good evidence that _start/_length_beats should actually be double rather than Evoral::Beats (adjusting a region by increments of less than a tick is desirable). --- libs/ardour/midi_region.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libs/ardour') diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index fee10e292c..d4cf35e82a 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -637,8 +637,8 @@ MidiRegion::trim_to_internal (framepos_t position, framecnt_t length, const int3 return; } - /* at small deltas, (high zooms) the property will not change without this. tick rounding?*/ - _start_beats = Evoral::Beats(); + /* at small deltas, (high zooms) the property will not change without this (tick resolution of Beats::operator!=)*/ + _start_beats += Evoral::Beats (new_start_qn) + start_beats().tick() * 2.0; _start_beats = Evoral::Beats (new_start_qn); what_changed.add (Properties::start_beats); -- cgit v1.2.3