summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorBen Loftis <ben@harrisonconsoles.com>2017-08-26 22:44:48 -0500
committerBen Loftis <ben@harrisonconsoles.com>2017-08-26 22:44:58 -0500
commit1c145ccfc37e0a16bf959de388ff098ca5f8f499 (patch)
treed2b6f368742e39b7d25bb9bc95e4003fe679b4c4 /gtk2_ardour
parent49765f8897784d83564c8301ed1ffe82d6bdab92 (diff)
Editor zooming: Config preference to define how much zooming will be easily allowed beyond the session_ui_extents()
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_canvas.cc20
-rw-r--r--gtk2_ardour/editor_ops.cc6
-rw-r--r--gtk2_ardour/rc_option_editor.cc12
-rw-r--r--gtk2_ardour/ui_config_vars.h1
4 files changed, 32 insertions, 7 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index 565dbf0b78..729034a204 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -584,6 +584,10 @@ Editor::autoscroll_active () const
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();
@@ -611,10 +615,18 @@ Editor::session_gui_extents () const
//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;
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index a0370d0d7e..f8c7a9c546 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -1790,11 +1790,11 @@ Editor::temporal_zoom_step_scale (bool zoom_out, double scale)
}
//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);
}
diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc
index ea7db58809..0cf2ed41f3 100644
--- a/gtk2_ardour/rc_option_editor.cc
+++ b/gtk2_ardour/rc_option_editor.cc
@@ -2345,6 +2345,18 @@ RCOptionEditor::RCOptionEditor ()
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"),
diff --git a/gtk2_ardour/ui_config_vars.h b/gtk2_ardour/ui_config_vars.h
index 0bf9a2c15a..9fa7373151 100644
--- a/gtk2_ardour/ui_config_vars.h
+++ b/gtk2_ardour/ui_config_vars.h
@@ -33,6 +33,7 @@ UI_CONFIG_VARIABLE (bool, show_waveform_clipping, "show-waveform-clipping", true
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")