summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-03-12 20:44:48 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-03-12 20:44:48 +0000
commit6a869dfb7a5ff2393553037e0cff31c9484403f3 (patch)
tree56dfb18aaf18b57f7eb6b92400bde6d5336770cc /gtk2_ardour/editor.cc
parent8e530cba687fa7a8f5e27eff05b4f52276a33456 (diff)
if we attempt to move beyond the limit of the current horizontal adjustment, change its upper limit so that we keep scrolling (fixes a bug with playhead tracking beyond the current session end
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4807 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor.cc')
-rw-r--r--gtk2_ardour/editor.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index d2d7a5e69e..e365382331 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -4287,7 +4287,6 @@ Editor::on_key_release_event (GdkEventKey* ev)
void
Editor::reset_x_origin (nframes64_t frame)
{
- //cerr << "resetting x origin" << endl;
queue_visual_change (frame);
}
@@ -4476,12 +4475,19 @@ Editor::post_zoom ()
void
Editor::queue_visual_change (nframes64_t where)
{
-// pending_visual_change.pending = VisualChange::Type (pending_visual_change.pending | VisualChange::TimeOrigin);
-// pending_visual_change.time_origin = where;
+ pending_visual_change.pending = VisualChange::Type (pending_visual_change.pending | VisualChange::TimeOrigin);
+
+ /* if we're moving beyond the end, make sure the upper limit of the horizontal adjustment
+ can reach.
+ */
+
+ if (where > session->current_end_frame()) {
+ horizontal_adjustment.set_upper ((where + current_page_frames()) / frames_per_unit);
+ }
+
+ pending_visual_change.time_origin = where;
if (pending_visual_change.idle_handler_id < 0) {
- pending_visual_change.pending = VisualChange::Type (pending_visual_change.pending | VisualChange::TimeOrigin);
- pending_visual_change.time_origin = where;
pending_visual_change.idle_handler_id = g_idle_add (_idle_visual_changer, this);
}
}
@@ -4523,7 +4529,7 @@ Editor::idle_visual_changer ()
update_fixed_rulers ();
redisplay_tempo (true);
}
- //cerr << "Editor::idle_visual_changer () called ha v:l:u:ps:fpu = " << horizontal_adjustment.get_value() << ":" << horizontal_adjustment.get_lower() << ":" << horizontal_adjustment.get_upper() << ":" << horizontal_adjustment.get_page_size() << ":" << frames_per_unit << endl;//DEBUG
+ // cerr << "Editor::idle_visual_changer () called ha v:l:u:ps:fpu = " << horizontal_adjustment.get_value() << ":" << horizontal_adjustment.get_lower() << ":" << horizontal_adjustment.get_upper() << ":" << horizontal_adjustment.get_page_size() << ":" << frames_per_unit << endl;//DEBUG
pending_visual_change.idle_handler_id = -1;
return 0; /* this is always a one-shot call */
}