+ const samplepos_t old_pos = _position;
+ const samplepos_t old_length = _length;
+ const samplepos_t old_start = _start;
+
+ PropertyChange s_and_l;
+
+ if (position_lock_style() == AudioTime) {
+ recompute_position_from_lock_style (0);
+
+ /*
+ set _start to new position in tempo map.
+
+ The user probably expects the region contents to maintain audio position as the
+ tempo changes, but AFAICT this requires modifying the src file to use
+ SMPTE timestamps with the current disk read model (?).
+
+ We could arguably use _start to set _start_beats here,
+ resulting in viewport-like behaviour (the contents maintain
+ their musical position while the region is stationary).
+
+ For now, the musical position at the region start is retained, but subsequent events
+ will maintain their beat distance according to the map.
+ */
+ _start = _session.tempo_map().samples_between_quarter_notes (quarter_note() - start_beats(), quarter_note());
+
+ /* _length doesn't change for audio-locked regions. update length_beats to match. */
+ _length_beats = _session.tempo_map().quarter_note_at_sample (_position + _length) - quarter_note();
+
+ s_and_l.add (Properties::start);
+ s_and_l.add (Properties::length_beats);
+
+ send_change (s_and_l);
+ return;
+ }