+ boost::shared_ptr<Playlist> pl (playlist());
+
+ if (!pl) {
+ return;
+ }
+
+ const framepos_t old_pos = _position;
+ const framepos_t old_length = _length;
+ const framepos_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().frames_between_quarter_notes (pos_beats() - start_beats(), pos_beats());
+
+ /* _length doesn't change for audio-locked regions. update length_beats to match. */
+ _length_beats = _session.tempo_map().quarter_note_at_frame (_position + _length) - pos_beats();
+
+ s_and_l.add (Properties::start);
+ s_and_l.add (Properties::length_beats);
+
+ send_change (s_and_l);
+ return;
+ }
+