diff base/View.h @ 33:51e158b505da

* Rearrange spectrogram cacheing so that gain, normalization, instantaneous frequency calculations etc can be done from the cached data (increasing the size of the cache, but also the usability).
author Chris Cannam
date Thu, 23 Feb 2006 18:01:31 +0000
parents 4afaf0df4d51
children aaf73f7309f2
line wrap: on
line diff
--- a/base/View.h	Mon Feb 20 17:23:40 2006 +0000
+++ b/base/View.h	Thu Feb 23 18:01:31 2006 +0000
@@ -96,6 +96,26 @@
     long getFrameForX(int x) const;
 
     /**
+     * Return the pixel y-coordinate corresponding to a given
+     * frequency, if the frequency range is as specified.  This does
+     * not imply any policy about layer frequency ranges, but it might
+     * be useful for layers to match theirs up if desired.
+     *
+     * Not thread-safe in logarithmic mode.  Call only from GUI thread.
+     */
+    float getYForFrequency(float frequency, float minFreq, float maxFreq, 
+			   bool logarithmic) const;
+
+    /**
+     * Return the closest frequency to the given pixel y-coordinate,
+     * if the frequency range is as specified.
+     *
+     * Not thread-safe in logarithmic mode.  Call only from GUI thread.
+     */
+    float getFrequencyForY(int y, float minFreq, float maxFreq,
+			   bool logarithmic) const;
+
+    /**
      * Return the zoom level, i.e. the number of frames per pixel
      */
     int getZoomLevel() const;