- if (_alignment_style == ExistingMaterial) {
- last_recordable_frame += _session.worst_output_latency();
- } else {
- last_recordable_frame += _roll_delay;
- }
-
- //first_recordable_frame = max_frames;
-
- DEBUG_TRACE (DEBUG::Latency, string_compose ("Stop record - %6 | %7. Capture offset: %1 Worst O/P Latency: %2 Roll Delay: %3 First Recordable Frame: %4 Transport Frame: %5\n",
- _capture_offset, _session.worst_output_latency(), _roll_delay, first_recordable_frame, transport_frame,
- can_record, record_enabled()));
- }
+ } else {
+ capture_start_frame -= _roll_delay;
+ }
+ }
+
+ prepare_record_status (capture_start_frame);
+
+ } else {
+
+ if (last_possibly_recording == fully_rec_enabled) {
+
+ /* we were recording last time */
+
+ if (change & transport_rolling) {
+ /* transport-change (stopped rolling): last_recordable_frame was set in ::prepare_to_stop() */
+
+ } else {
+ /* punch out */
+
+ last_recordable_frame = transport_frame + _capture_offset;
+
+ if (_alignment_style == ExistingMaterial) {
+ if (_session.worst_output_latency() > _capture_offset) {
+ last_recordable_frame += (_session.worst_output_latency() - _capture_offset);
+ }
+ } else {
+ last_recordable_frame += _roll_delay;
+ }
+ }
+ }
+ }