Fix #2932; arrange the view more carefully when going to start / end / wallclock.

git-svn-id: svn://localhost/ardour2/branches/3.0@6183 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2009-11-26 01:51:50 +00:00
parent 8cfc9679af
commit c07f42b9f4
3 changed files with 8 additions and 6 deletions

View File

@ -1383,13 +1383,12 @@ ARDOUR_UI::transport_goto_start ()
if (session) {
session->goto_start();
/* force displayed area in editor to start no matter
what "follow playhead" setting is.
*/
if (editor) {
editor->reset_x_origin (session->current_start_frame());
editor->center_screen (session->current_start_frame ());
}
}
}
@ -1434,7 +1433,7 @@ ARDOUR_UI::transport_goto_wallclock ()
*/
if (editor) {
editor->reset_x_origin (frames - (editor->current_page_frames()/2));
editor->center_screen (frames);
}
}
}
@ -1443,7 +1442,7 @@ void
ARDOUR_UI::transport_goto_end ()
{
if (session) {
nframes_t frame = session->current_end_frame();
nframes_t const frame = session->current_end_frame();
session->request_locate (frame);
/* force displayed area in editor to start no matter
@ -1451,7 +1450,7 @@ ARDOUR_UI::transport_goto_end ()
*/
if (editor) {
editor->reset_x_origin (frame);
editor->center_screen (frame);
}
}
}

View File

@ -432,6 +432,8 @@ class Editor : public PublicEditor
void show_verbose_canvas_cursor_with (const std::string& txt);
void hide_verbose_canvas_cursor();
void center_screen (nframes64_t);
protected:
void map_transport_state ();
void map_position_change (nframes64_t);
@ -982,7 +984,6 @@ class Editor : public PublicEditor
sigc::connection scroll_connection;
nframes64_t last_update_frame;
void center_screen (nframes64_t);
void center_screen_internal (nframes64_t, float);
void update_current_screen ();

View File

@ -351,6 +351,8 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway
virtual void show_verbose_canvas_cursor_with (const std::string& txt) = 0;
virtual void hide_verbose_canvas_cursor() = 0;
virtual void center_screen (nframes64_t) = 0;
/// Singleton instance, set up by Editor::Editor()
static PublicEditor* _instance;