changeset 1520:4eafe5a1b655 time-frequency-boxes

Tidying
author Chris Cannam
date Wed, 25 Sep 2019 09:46:27 +0100
parents 235e08aa2d5d
children d3ef60b6ae93
files layer/Layer.h layer/SliceableLayer.h layer/SpectrogramLayer.h layer/VerticalBinLayer.h view/View.h
diffstat 5 files changed, 17 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/layer/Layer.h	Wed Sep 25 09:46:20 2019 +0100
+++ b/layer/Layer.h	Wed Sep 25 09:46:27 2019 +0100
@@ -488,6 +488,17 @@
     }
 
     /**
+     * Consider using the given value extents and units for this
+     * layer. This may be called on a new layer when added, to prepare
+     * it for editing, and the extents are those of the layer
+     * underneath it. May not be appropriate for most layer types.
+     */
+    virtual bool adoptExtents(double /* min */, double /* max */,
+                              QString /* unit */) {
+        return false;
+    }
+    
+    /**
      * Return the value and unit at the given x coordinate in the
      * given view.  This is for descriptive purposes using the
      * measurement tool.  The default implementation works correctly
--- a/layer/SliceableLayer.h	Wed Sep 25 09:46:20 2019 +0100
+++ b/layer/SliceableLayer.h	Wed Sep 25 09:46:27 2019 +0100
@@ -35,14 +35,6 @@
     // The SliceableLayer retains ownership of the model, and will
     // emit sliceableModelReplaced if it is about to become invalid.
     virtual ModelId getSliceableModel() const = 0;
-/*!!!
-signals:
-    // Emitted when a model that was obtained through
-    // getSliceableModel is about to be deleted.  If replacement is
-    // non-NULL, it may be used instead.
-    void sliceableModelReplaced(const Model *modelToBeReplaced,
-                                const Model *replacement);
-*/
 };
 
 #endif
--- a/layer/SpectrogramLayer.h	Wed Sep 25 09:46:20 2019 +0100
+++ b/layer/SpectrogramLayer.h	Wed Sep 25 09:46:27 2019 +0100
@@ -230,7 +230,7 @@
     QString getError(LayerGeometryProvider *v) const override;
 
     bool getValueExtents(double &min, double &max,
-                                 bool &logarithmic, QString &unit) const override;
+                         bool &logarithmic, QString &unit) const override;
 
     bool getDisplayExtents(double &min, double &max) const override;
 
--- a/layer/VerticalBinLayer.h	Wed Sep 25 09:46:20 2019 +0100
+++ b/layer/VerticalBinLayer.h	Wed Sep 25 09:46:27 2019 +0100
@@ -20,9 +20,10 @@
 
 /**
  * Interface for layers in which the Y axis corresponds to bin number
- * rather than scale value. Colour3DPlotLayer is the obvious example.
- * Conceptually these are always SliceableLayers as well, and this
- * subclasses from SliceableLayer to avoid a big inheritance mess.
+ * rather than scale value. Colour3DPlotLayer and SpectrogramLayer are
+ * obvious examples.  Conceptually these are always SliceableLayers as
+ * well, and this subclasses from SliceableLayer to avoid a big
+ * inheritance mess.
  */
 class VerticalBinLayer : public SliceableLayer
 {
--- a/view/View.h	Wed Sep 25 09:46:20 2019 +0100
+++ b/view/View.h	Wed Sep 25 09:46:27 2019 +0100
@@ -354,7 +354,7 @@
     int getTextLabelHeight(const Layer *layer, QPainter &) const override;
 
     bool getValueExtents(QString unit, double &min, double &max,
-                                 bool &log) const override;
+                         bool &log) const override;
 
     void toXml(QTextStream &stream, QString indent = "",
                        QString extraAttributes = "") const override;