}
//zoom-behavior-tweaks
- //limit our maximum zoom to the session gui extents value (+10%)
+ //limit our maximum zoom to the session gui extents value
std::pair<framepos_t, framepos_t> ext = session_gui_extents();
framecnt_t session_extents_pp = ( ext.second - ext.first ) / _visible_canvas_width;
- if (nspp > session_extents_pp * 1.1)
- nspp = session_extents_pp * 1.1;
+ if (nspp > session_extents_pp)
+ nspp = session_extents_pp;
temporal_zoom (nspp);
}
}
}
+void
+Editor::temporal_zoom_extents ()
+{
+ ENSURE_GUI_THREAD (*this, &Editor::temporal_zoom_extents)
+
+ if (_session) {
+ std::pair<framepos_t, framepos_t> ext = session_gui_extents( false ); //in this case we want to zoom to the extents explicitly; ignore the users prefs for extra padding
+
+ framecnt_t start = ext.first;
+ framecnt_t end = ext.second;
+
+ if (_session->actively_recording () ) {
+ framepos_t cur = playhead_cursor->current_frame ();
+ if (cur > end) {
+ /* recording beyond the end marker; zoom out
+ * by 5 seconds more so that if 'follow
+ * playhead' is active we don't immediately
+ * scroll.
+ */
+ end = cur + _session->frame_rate() * 5;
+ }
+ }
+
+ if ((start == 0 && end == 0) || end < start) {
+ return;
+ }
+
+ calc_extra_zoom_edges(start, end);
+
+ temporal_zoom_by_frame (start, end);
+ }
+}
+
void
Editor::temporal_zoom_by_frame (framepos_t start, framepos_t end)
{