diff layer/Layer.h @ 133:9e6b3e239b9d

* Add zoom thumbwheels to Pane. Implement horizontal thumbwheel, and vertical depending on layer type (supported for waveform and spectrogram, though wrong for log-scale spectrogram at the moment). * Add bare bones of a spectrum layer. * Add window icon * Add shortcut for "insert time instant" on laptops without keypad enter (";") * Delete FFT processing thread when it exits (at least, next time we're asked for something interesting) * Get audio file extensions from the file readers, and thus from libsndfile for the wave file reader -- leads to rather a wide combo box in file dialog though * Better refresh order for spectrogram (redraw centre section first)
author Chris Cannam
date Fri, 04 Aug 2006 17:01:37 +0000
parents eaae73b6bd28
children 10a82b2bbb8b
line wrap: on
line diff
--- a/layer/Layer.h	Thu Aug 03 15:40:11 2006 +0000
+++ b/layer/Layer.h	Fri Aug 04 17:01:37 2006 +0000
@@ -280,6 +280,34 @@
         return false;
     }
 
+    /**
+     * Get the number of vertical zoom steps available for this layer.
+     * If vertical zooming is not available, return 0.  The meaning of
+     * "zooming" is entirely up to the layer -- changing the zoom
+     * level may cause the layer to reset its display extents or
+     * change another property such as display gain.
+     * Layers that provide this facility should also emit the
+     * verticalZoomChanged signal if their vertical zoom changes
+     * due to factors other than setVerticalZoomStep being called.
+     */
+    virtual int getVerticalZoomSteps(int &defaultStep) const { return 0; }
+
+    /**
+     * Get the current vertical zoom step.  A layer may support finer
+     * control over ranges etc than is available through the integer
+     * zoom step mechanism; if this one does, it should just return
+     * the nearest of the available zoom steps to the current settings.
+     */
+    virtual int getCurrentVerticalZoomStep() const { return 0; }
+
+    /**
+     * Set the vertical zoom step.  The meaning of "zooming" is
+     * entirely up to the layer -- changing the zoom level may cause
+     * the layer to reset its display extents or change another
+     * property such as display gain.
+     */
+    virtual void setVerticalZoomStep(int) { }
+
 public slots:
     void showLayer(View *, bool show);
 
@@ -292,6 +320,8 @@
     void layerParametersChanged();
     void layerNameChanged();
 
+    void verticalZoomChanged();
+
 private:
     mutable QMutex m_dormancyMutex;
     mutable std::map<const void *, bool> m_dormancy;