removal of sundry Adjustments and consolidation of scrolling around two editor-owned...
[ardour.git] / gtk2_ardour / editor.h
index 897ea0afee249e4c44e1f99113409a91c39ea0d6..2da7650ce5c12fa7fa830d79621c4e62e26cd790 100644 (file)
@@ -147,10 +147,10 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void             first_idle ();
        virtual bool     have_idled () const { return _have_idled; }
 
-       framepos_t leftmost_position() const { return leftmost_frame; }
+       framepos_t leftmost_sample() const { return leftmost_frame; }
 
-       framecnt_t current_page_frames() const {
-               return (framecnt_t) floor (_visible_canvas_width * frames_per_pixel);
+       framecnt_t current_page_samples() const {
+               return (framecnt_t) floor (_visible_canvas_width * samples_per_pixel);
        }
 
        double visible_canvas_height () const {
@@ -221,13 +221,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void transition_to_rolling (bool forward);
 
        /* NOTE: these functions assume that the "pixel" coordinate is
-          the result of using the world->canvas affine transform on a
-          world coordinate. These coordinates already take into
-          account any scrolling carried out by adjusting the
-          xscroll_adjustment.
+          in canvas coordinates. These coordinates already take into
+          account any scrolling offsets.
        */
 
-       framepos_t pixel_to_frame (double pixel) const {
+       framepos_t pixel_to_sample (double pixel) const {
 
                /* pixel can be less than zero when motion events
                   are processed. since we've already run the world->canvas
@@ -236,22 +234,20 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
                */
 
                if (pixel >= 0) {
-                       return (framepos_t) rint (pixel * frames_per_pixel);
+                       return (framepos_t) rint (pixel * samples_per_pixel);
                } else {
                        return 0;
                }
        }
 
-       double frame_to_pixel (framepos_t frame) const {
-               return rint (frame / frames_per_pixel);
+       double sample_to_pixel (framepos_t sample) const {
+               return rint (sample / samples_per_pixel);
        }
 
-       double frame_to_pixel_unrounded (framepos_t frame) const {
-               return frame / frames_per_pixel;
+       double sample_to_pixel_unrounded (framepos_t sample) const {
+               return sample / samples_per_pixel;
        }
 
-       void flush_canvas ();
-
        /* selection */
 
        Selection& get_selection() const { return *selection; }
@@ -296,7 +292,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        void               set_zoom_focus (Editing::ZoomFocus);
        Editing::ZoomFocus get_zoom_focus () const { return zoom_focus; }
-       double             get_current_zoom () const { return frames_per_pixel; }
+       double             get_current_zoom () const { return samples_per_pixel; }
         void               cycle_zoom_focus ();
        void temporal_zoom_step (bool coarser);
        void tav_zoom_step (bool coarser);
@@ -483,7 +479,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
            VisualState (bool with_tracks);
            ~VisualState ();
            double              y_position;
-           double              frames_per_pixel;
+           double              samples_per_pixel;
            framepos_t          leftmost_frame;
            Editing::ZoomFocus  zoom_focus;
            GUIObjectState*     gui_state;
@@ -503,11 +499,11 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void cancel_visual_state_op (uint32_t n);
 
        framepos_t leftmost_frame;
-       double      frames_per_pixel;
+       double      samples_per_pixel;
        Editing::ZoomFocus zoom_focus;
 
-       void set_frames_per_pixel (double);
-       bool clamp_frames_per_pixel (double &) const;
+       void set_samples_per_pixel (double);
+       bool clamp_samples_per_pixel (double &) const;
 
        Editing::MouseMode mouse_mode;
        Editing::MouseMode pre_internal_mouse_mode;
@@ -700,12 +696,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        ArdourCanvas::GtkCanvas* _track_canvas;
        ArdourCanvas::GtkCanvasViewport* _track_canvas_viewport;
-        Gtk::Adjustment* _track_canvas_hadj;
-        Gtk::Adjustment* _track_canvas_vadj;
 
         ArdourCanvas::GtkCanvas* _time_bars_canvas;
         ArdourCanvas::GtkCanvasViewport* _time_bars_canvas_viewport;
-       Gtk::Adjustment* _time_bars_canvas_hadj;
        Gtk::Adjustment* _time_bars_canvas_vadj;
 
        bool within_track_canvas;
@@ -974,7 +967,9 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
        /** the adjustment that controls the overall editor vertical scroll position */
        Gtk::Adjustment     vertical_adjustment;
+        Gtk::Adjustment     horizontal_adjustment;
 
+        Gtk::Adjustment     unused_adjustment; // yes, really; Gtk::Layout constructor requires refs
        Gtk::Layout         controls_layout;
        bool control_layout_scroll (GdkEventScroll* ev);
        void reset_controls_layout_width ();
@@ -1039,14 +1034,14 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
 
                Type pending;
                framepos_t time_origin;
-               double frames_per_pixel;
+               double samples_per_pixel;
                double y_origin;
 
                int idle_handler_id;
                /** true if we are currently in the idle handler */
                bool being_handled;
 
-               VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), frames_per_pixel (0), idle_handler_id (-1), being_handled (false) {}
+               VisualChange() : pending ((VisualChange::Type) 0), time_origin (0), samples_per_pixel (0), idle_handler_id (-1), being_handled (false) {}
                void add (Type t) {
                        pending = Type (pending | t);
                }
@@ -2086,8 +2081,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
        void region_view_added (RegionView *);
        void region_view_removed ();
 
-       void update_canvas_now ();
-
        EditorGroupTabs* _group_tabs;
        void fit_route_group (ARDOUR::RouteGroup *);