13
0

Clean up the idle_visual_changer a bit, fixing a bug where the playhead would jump around when zooming a lot with playhead zoom focus.

git-svn-id: svn://localhost/ardour2/branches/3.0@6462 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-01-06 01:37:38 +00:00
parent ea7cb51ed8
commit 8418f8cea6

View File

@ -4325,38 +4325,25 @@ Editor::idle_visual_changer ()
update_tempo_based_rulers ();
}
if (p & VisualChange::TimeOrigin) {
// Add a little extra so we can see the end marker
nframes64_t e = 0;
if (_session) {
e = _session->current_end_frame ();
}
e += current_page_frames () / 10;
horizontal_adjustment.set_upper (e / frames_per_unit);
horizontal_adjustment.set_value (pending_visual_change.time_origin / frames_per_unit);
}
if (p & VisualChange::YOrigin) {
vertical_adjustment.set_value (pending_visual_change.y_origin);
}
nframes64_t csf=0, cef=0;
nframes64_t current_time_origin = (nframes64_t) floor (horizontal_adjustment.get_value() * frames_per_unit);
if (_session) {
csf = _session->current_start_frame();
cef = _session->current_end_frame();
}
/* if we seek beyond the current end of the canvas, move the end */
if (last_time_origin == horizontal_adjustment.get_value() ) {
if (last_time_origin == horizontal_adjustment.get_value()) {
/* changed signal not emitted */
update_fixed_rulers ();
redisplay_tempo (true);
}
if (current_time_origin != pending_visual_change.time_origin) {
cef += current_page_frames() / 10; // Add a little extra so we can see the end marker
horizontal_adjustment.set_upper (cef / frames_per_unit);
horizontal_adjustment.set_value (pending_visual_change.time_origin / frames_per_unit);
} else {
update_fixed_rulers();
redisplay_tempo (true);
}
_summary->set_overlays_dirty ();
// 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
@ -4753,7 +4740,7 @@ Editor::idle_resize ()
void
Editor::located ()
{
ENSURE_GUI_THREAD (*this, &Editor::located)
ENSURE_GUI_THREAD (*this, &Editor::located);
_pending_locate_request = false;
}