From 3f24d5d96ea6c930a071d955b33804bc901e9b0e Mon Sep 17 00:00:00 2001 From: nick_m Date: Sat, 13 Aug 2016 04:18:21 +1000 Subject: Always send start property changes when a midi region trim alters position. - ensures gui updates correctly. --- libs/ardour/midi_region.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'libs/ardour/midi_region.cc') diff --git a/libs/ardour/midi_region.cc b/libs/ardour/midi_region.cc index 0ea0ed6a99..4e7cbf6c4d 100644 --- a/libs/ardour/midi_region.cc +++ b/libs/ardour/midi_region.cc @@ -563,8 +563,6 @@ MidiRegion::set_start_internal (framecnt_t s, const int32_t sub_num) void MidiRegion::trim_to_internal (framepos_t position, framecnt_t length, const int32_t sub_num) { - framepos_t new_start; - if (locked()) { return; } @@ -587,18 +585,17 @@ MidiRegion::trim_to_internal (framepos_t position, framecnt_t length, const int3 */ if (_position != position) { + /* sets _beat to new position.*/ set_position_internal (position, true, sub_num); what_changed.add (Properties::position); - } - const double new_start_beat = _start_beats.val().to_double() + beat_delta; - new_start = _position - _session.tempo_map().frame_at_beat (beat() - new_start_beat); + const double new_start_beat = _start_beats.val().to_double() + beat_delta; + const framepos_t new_start = _position - _session.tempo_map().frame_at_beat (beat() - new_start_beat); - if (!verify_start_and_length (new_start, length)) { - return; - } + if (!verify_start_and_length (new_start, length)) { + return; + } - if (_start != new_start) { _start_beats = Evoral::Beats (new_start_beat); what_changed.add (Properties::start_beats); @@ -607,6 +604,11 @@ MidiRegion::trim_to_internal (framepos_t position, framecnt_t length, const int3 } if (_length != length) { + + if (!verify_start_and_length (_start, length)) { + return; + } + set_length_internal (length, sub_num); what_changed.add (Properties::length); what_changed.add (Properties::length_beats); -- cgit v1.2.3