# HG changeset patch # User Chris Cannam # Date 1153328129 0 # Node ID 8ce30801f39afcbee9c6ca76ec13e3efbd0b27b9 # Parent 6332e41c161942190c3284f061a55ca1c8181cc0 * some work on scaling and zooming for spectrogram diff -r 6332e41c1619 -r 8ce30801f39a base/Layer.h --- a/base/Layer.h Fri Jul 14 17:12:16 2006 +0000 +++ b/base/Layer.h Wed Jul 19 16:55:29 2006 +0000 @@ -232,13 +232,41 @@ virtual bool needsTextLabelHeight() const { return false; } + /** + * 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 + * these values if known. + * + * This function returns the "normal" extents for the layer, not + * necessarily the extents actually in use in the display. + */ virtual bool getValueExtents(float &min, float &max, bool &logarithmic, QString &unit) const = 0; + /** + * Return the minimum and maximum values within the displayed + * range for the y axis, if only a subset of the whole range of + * the model (returned by getValueExtents) is being displayed. + * Return false if the layer is not imposing a particular display + * extent (using the normal layer extents or deferring to whatever + * is in use for the same units elsewhere in the view). + */ virtual bool getDisplayExtents(float &min, float &max) const { return false; } + /** + * Set the displayed minimum and maximum values for the y axis to + * the given range, if supported. Return false if not supported + * on this layer (and set nothing). In most cases, layers that + * return false for getDisplayExtents should also return false for + * this function. + */ + virtual bool setDisplayExtents(float min, float max) { + return false; + } + public slots: void showLayer(View *, bool show);