std::pair <framepos_t,framepos_t>
Editor::session_gui_extents () const
{
+ if (!_session) {
+ return std::pair <framepos_t,framepos_t>(max_framepos,0);
+ }
+
framecnt_t session_extent_start = _session->current_start_frame();
framecnt_t session_extent_end = _session->current_end_frame();
//ToDo: also incorporate automation regions (in case the session has no audio/midi but is just used for automating plugins or the like)
- //if all else fails, give us 2 minutes
- framecnt_t const min_length = _session->nominal_frame_rate()*60*2;
- if ( session_extent_end < min_length )
- session_extent_end = min_length;
+ //add additional time to the ui extents ( user-defined in config )
+ framecnt_t const extra = UIConfiguration::instance().get_extra_ui_extents_time() * 60 * _session->nominal_frame_rate();
+ session_extent_end += extra;
+ session_extent_start -= extra;
+
+ //range-check
+ if (session_extent_end > max_framepos) {
+ session_extent_end = max_framepos;
+ }
+ if (session_extent_start < 0) {
+ session_extent_start = 0;
+ }
std::pair <framepos_t,framepos_t> ret (session_extent_start, session_extent_end);
return ret;
}
//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);
}
dps->add (1.0, _("100%"));
add_option (_("Editor"), dps);
+ ComboOption<float>* eet = new ComboOption<float> (
+ "extra-ui-extents-time",
+ _("Limit zooming & summary view to X minutes beyond session extents"),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_extra_ui_extents_time),
+ sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_extra_ui_extents_time)
+ );
+ eet->add (1, _("1 minute"));
+ eet->add (2, _("2 minutes"));
+ eet->add (20, _("20 minutes"));
+ eet->add (60, _("1 hour"));
+ add_option (_("Editor"), eet);
+
if (!Profile->get_mixbus()) {
add_option (_("Editor"),
UI_CONFIG_VARIABLE (uint32_t, lock_gui_after_seconds, "lock-gui-after-seconds", 0)
UI_CONFIG_VARIABLE (bool, draggable_playhead, "draggable-playhead", true)
UI_CONFIG_VARIABLE (float, draggable_playhead_speed, "draggable-playhead-speed", 1.0)
+UI_CONFIG_VARIABLE (float, extra_ui_extents_time, "extra-ui-extents-time", 1.0)
UI_CONFIG_VARIABLE (bool, new_automation_points_on_lane, "new-automation-points-on-lane", false)
UI_CONFIG_VARIABLE (std::string, keyboard_layout, "keyboard-layout", "ansi")
UI_CONFIG_VARIABLE (std::string, keyboard_layout_name, "keyboard-layout-name", "ansi")