diff view/View.h @ 1353:86429ff00f05

Merge from branch zoom
author Chris Cannam
date Wed, 10 Oct 2018 08:44:27 +0100
parents 13d9b422f7fe
children 40b9a495a0e0
line wrap: on
line diff
--- a/view/View.h	Wed Oct 03 12:59:55 2018 +0100
+++ b/view/View.h	Wed Oct 10 08:44:27 2018 +0100
@@ -148,16 +148,17 @@
                             bool logarithmic) const;
 
     /**
-     * Return the zoom level, i.e. the number of frames per pixel
+     * Return the zoom level, i.e. the number of frames per pixel or
+     * pixels per frame
      */
-    int getZoomLevel() const;
+    ZoomLevel getZoomLevel() const;
 
     /**
-     * Set the zoom level, i.e. the number of frames per pixel.  The
-     * centre frame will be unchanged; the start and end frames will
-     * change.
+     * Set the zoom level, i.e. the number of frames per pixel or
+     * pixels per frame.  The centre frame will be unchanged; the
+     * start and end frames will change.
      */
-    virtual void setZoomLevel(int z);
+    virtual void setZoomLevel(ZoomLevel z);
 
     /**
      * Zoom in or out.
@@ -400,7 +401,7 @@
                             bool globalScroll,
                             PlaybackFollowMode followMode);
 
-    void zoomLevelChanged(int level, bool locked);
+    void zoomLevelChanged(ZoomLevel level, bool locked);
 
     void contextHelpChanged(const QString &);
 
@@ -418,7 +419,7 @@
     virtual void globalCentreFrameChanged(sv_frame_t);
     virtual void viewCentreFrameChanged(View *, sv_frame_t);
     virtual void viewManagerPlaybackFrameChanged(sv_frame_t);
-    virtual void viewZoomLevelChanged(View *, int, bool);
+    virtual void viewZoomLevelChanged(View *, ZoomLevel, bool);
 
     virtual void propertyContainerSelected(View *, PropertyContainer *pc);
 
@@ -456,9 +457,9 @@
     bool areLayersScrollable() const;
     LayerList getScrollableBackLayers(bool testChanged, bool &changed) const;
     LayerList getNonScrollableFrontLayers(bool testChanged, bool &changed) const;
-    int getZoomConstraintBlockSize(int blockSize,
-                                      ZoomConstraint::RoundingDirection dir =
-                                      ZoomConstraint::RoundNearest) const;
+    ZoomLevel getZoomConstraintLevel(ZoomLevel level,
+                                     ZoomConstraint::RoundingDirection dir =
+                                     ZoomConstraint::RoundNearest) const;
 
     // True if the top layer(s) use colours for meaningful things.  If
     // this is the case, selections will be shown using unfilled boxes
@@ -481,7 +482,7 @@
     int effectiveDevicePixelRatio() const;
 
     sv_frame_t          m_centreFrame;
-    int                 m_zoomLevel;
+    ZoomLevel           m_zoomLevel;
     bool                m_followPan;
     bool                m_followZoom;
     PlaybackFollowMode  m_followPlay;
@@ -493,7 +494,7 @@
     QPixmap            *m_cache;  // I own this
     QPixmap            *m_buffer; // I own this
     sv_frame_t          m_cacheCentreFrame;
-    int                 m_cacheZoomLevel;
+    ZoomLevel           m_cacheZoomLevel;
     bool                m_selectionCached;
 
     bool                m_deleting;