+ default:
+ fatal << "Editor::smpte_snap_to_internal() called with non-timecode snap type!" << endmsg;
+ /*NOTREACHED*/
+ }
+}
+
+void
+Editor::snap_to_internal (nframes64_t& start, int32_t direction, bool for_mark)
+{
+ const nframes64_t one_second = session->frame_rate();
+ const nframes64_t one_minute = session->frame_rate() * 60;
+ nframes64_t presnap = start;
+ nframes64_t before;
+ nframes64_t after;
+
+ switch (_snap_type) {
+ case SnapToTimecodeFrame:
+ case SnapToTimecodeSeconds:
+ case SnapToTimecodeMinutes:
+ return timecode_snap_to_internal (start, direction, for_mark);
+
+ case SnapToCDFrame:
+ if (((direction == 0) && (start % (one_second/75) > (one_second/75) / 2)) || (direction > 0)) {
+ start = (nframes64_t) ceil ((double) start / (one_second / 75)) * (one_second / 75);
+ } else {
+ start = (nframes64_t) floor ((double) start / (one_second / 75)) * (one_second / 75);
+ }
+ break;
+