diff layer/Layer.h @ 1395:32bbb86094c3

Merge from branch spectrogramparam
author Chris Cannam
date Wed, 14 Nov 2018 14:23:17 +0000
parents c39f2d439d59
children a18e78b9c78b
line wrap: on
line diff
--- a/layer/Layer.h	Tue Nov 06 15:42:06 2018 +0000
+++ b/layer/Layer.h	Wed Nov 14 14:23:17 2018 +0000
@@ -136,6 +136,8 @@
     virtual void paintVerticalScale(LayerGeometryProvider *, bool /* detailed */,
                                     QPainter &, QRect) const { }
 
+    virtual int getHorizontalScaleHeight(LayerGeometryProvider *, QPainter &) const { return 0; }
+    
     virtual bool getCrosshairExtents(LayerGeometryProvider *, QPainter &, QPoint /* cursorPos */,
                                      std::vector<QRect> &) const {
         return false;
@@ -412,11 +414,32 @@
 
     virtual PlayParameters *getPlayParameters();
 
+    /**
+     * True if this layer will need to place text labels when it is
+     * painted. The view will take into account how many layers are
+     * requesting this, and will provide a distinct y-coord to each
+     * layer on request via View::getTextLabelHeight().
+     */
     virtual bool needsTextLabelHeight() const { return false; }
 
+    /**
+     * Return true if the X axis on the layer is time proportional to
+     * audio frames, false otherwise. Almost all layer types return
+     * true here: the exceptions are spectrum and slice layers.
+     */
     virtual bool hasTimeXAxis() const { return true; }
 
     /**
+     * Update the X and Y axis scales, where appropriate, to focus on
+     * the given rectangular region. This should *only* be overridden
+     * by layers whose hasTimeXAxis() returns false - the pane handles
+     * zooming appropriately in every "normal" case.
+     */
+    virtual void zoomToRegion(const LayerGeometryProvider *, QRect) {
+        return;
+    }
+
+    /**
      * Return the minimum and maximum values for the y axis of the
      * model in this layer, as well as whether the layer is configured
      * to use a logarithmic y axis display.  Also return the unit for