diff layer/SpectrogramLayer.h @ 1088:c520f90bbf2e spectrogram-minor-refactor

One FFT model per spectrogram (again!) - but we do still need a magnitude range per view, as views could be showing different regions
author Chris Cannam
date Tue, 05 Jul 2016 08:58:28 +0100
parents 6d990a24ac1b
children c8683d94442a
line wrap: on
line diff
--- a/layer/SpectrogramLayer.h	Sat Jul 02 12:56:07 2016 +0100
+++ b/layer/SpectrogramLayer.h	Tue Jul 05 08:58:28 2016 +0100
@@ -339,17 +339,10 @@
 
     int getFFTOversampling() const;
     int getFFTSize() const; // m_windowSize * getFFTOversampling()
-    
-    FFTModel *getFFTModel(const LayerGeometryProvider *v) const;
-    Dense3DModelPeakCache *getPeakCache(const LayerGeometryProvider *v) const;
-    void invalidateFFTModels();
 
-    typedef std::map<int, FFTModel *> ViewFFTMap; // key is view id
-    typedef std::map<int, Dense3DModelPeakCache *> PeakCacheMap; // key is view id
-    mutable ViewFFTMap m_fftModels;
-    mutable PeakCacheMap m_peakCaches;
+    mutable FFTModel *m_fftModel; //!!! should not be mutable, see getFFTModel()
+    mutable Dense3DModelPeakCache *m_peakCache;
     const int m_peakCacheDivisor;
-    mutable Model *m_sliceableModel;
 
     typedef std::map<int, MagnitudeRange> ViewMagMap; // key is view id
     mutable ViewMagMap m_viewMags;
@@ -357,6 +350,10 @@
     void invalidateMagnitudes();
     bool updateViewMagnitudes(LayerGeometryProvider *v) const;
     
+    FFTModel *getFFTModel() const;
+    Dense3DModelPeakCache *getPeakCache() const;
+    void invalidateFFTModel();
+    
     int paintDrawBuffer(LayerGeometryProvider *v, int w, int h,
                         const std::vector<int> &binforx,
                         const std::vector<double> &binfory,