summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-11-26 01:51:50 +0000
committerCarl Hetherington <carl@carlh.net>2009-11-26 01:51:50 +0000
commitc07f42b9f4162ec52932b0763cba2c649cb79f56 (patch)
treedb2654675ae4e138ec38de001a30ecb805150c4b
parent8cfc9679af27d290519a7b2c1216aa668a965b53 (diff)
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
-rw-r--r--gtk2_ardour/ardour_ui.cc9
-rw-r--r--gtk2_ardour/editor.h3
-rw-r--r--gtk2_ardour/public_editor.h2
3 files changed, 8 insertions, 6 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 343d933699..6bfcac13c6 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -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);
}
}
}
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index ca60eb7dac..34e810e345 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -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 ();
diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h
index 3540af927f..90d24dc802 100644
--- a/gtk2_ardour/public_editor.h
+++ b/gtk2_ardour/public_editor.h
@@ -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;