From 0e63fa65b5bf96040e752386083f80403042a6e6 Mon Sep 17 00:00:00 2001 From: nick_m Date: Sat, 18 Jun 2016 23:24:05 +1000 Subject: Remove frame conversion for MidiRegionView::note_in_region_range(), speed up tempo dilation --- libs/ardour/midi_region.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'libs/ardour/midi_region.cc') diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index 035c17c9de..ce473c162d 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -197,16 +197,25 @@ MidiRegion::set_length_internal (framecnt_t len, const int32_t& sub_num) void MidiRegion::update_after_tempo_map_change (bool /* send */) { + const framepos_t old_pos = _position; + const framepos_t old_length = _length; + const framepos_t old_start = _start; + Region::update_after_tempo_map_change (false); /* _start has now been updated. */ _length = _session.tempo_map().frame_at_beat (beat() + _length_beats.val().to_double()) - _position; PropertyChange s_and_l; - s_and_l.add (Properties::start); - s_and_l.add (Properties::length); - s_and_l.add (Properties::length_beats); - s_and_l.add (Properties::position); + if (old_start != _start) { + s_and_l.add (Properties::start); + } + if (old_length != _length) { + s_and_l.add (Properties::length); + } + if (old_pos != _position) { + s_and_l.add (Properties::position); + } send_change (s_and_l); } -- cgit v1.2.3