Fix #2932; arrange the view more carefully when going to start / end / wallclock.
authorCarl Hetherington <carl@carlh.net>
Thu, 26 Nov 2009 01:51:50 +0000 (01:51 +0000)
committerCarl Hetherington <carl@carlh.net>
Thu, 26 Nov 2009 01:51:50 +0000 (01:51 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@6183 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/ardour_ui.cc
gtk2_ardour/editor.h
gtk2_ardour/public_editor.h

index 343d9336993ef7f8818c6e27e1fe301028c0045c..6bfcac13c6b75349cc3c79fada4663e3f4fe53fe 100644 (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);
                }
        }
 }
index ca60eb7dac483db431e346fd55c9b1e16ec2301f..34e810e345daafd88c383a33b720eb355c53106f 100644 (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 ();
index 3540af927f1473004d99dce5ab9676316920f8a6..90d24dc8027bca1942b162cbb99a8ff38b98f8f8 100644 (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;