diff layer/SpectrogramLayer.h @ 1089:c8683d94442a spectrogram-minor-refactor

Start to introduce renderer objects
author Chris Cannam
date Tue, 05 Jul 2016 12:20:56 +0100
parents c520f90bbf2e
children 9b826dd23c84
line wrap: on
line diff
--- a/layer/SpectrogramLayer.h	Tue Jul 05 08:58:28 2016 +0100
+++ b/layer/SpectrogramLayer.h	Tue Jul 05 12:20:56 2016 +0100
@@ -41,7 +41,7 @@
 class QTimer;
 class FFTModel;
 class Dense3DModelPeakCache;
-
+class Colour3DPlotRenderer;
 
 /**
  * SpectrogramLayer represents waveform data (obtained from a
@@ -340,7 +340,7 @@
     int getFFTOversampling() const;
     int getFFTSize() const; // m_windowSize * getFFTOversampling()
 
-    mutable FFTModel *m_fftModel; //!!! should not be mutable, see getFFTModel()
+    mutable FFTModel *m_fftModel; //!!! should not be mutable, see getFFTModel()?
     mutable Dense3DModelPeakCache *m_peakCache;
     const int m_peakCacheDivisor;
 
@@ -349,10 +349,16 @@
     mutable std::vector<MagnitudeRange> m_columnMags;
     void invalidateMagnitudes();
     bool updateViewMagnitudes(LayerGeometryProvider *v) const;
+
+    typedef std::map<int, Colour3DPlotRenderer *> ViewRendererMap; // key is view id
+    mutable ViewRendererMap m_renderers;
+    Colour3DPlotRenderer *getRenderer(LayerGeometryProvider *) const;
     
     FFTModel *getFFTModel() const;
     Dense3DModelPeakCache *getPeakCache() const;
     void invalidateFFTModel();
+
+    void paintAlternative(LayerGeometryProvider *v, QPainter &paint, QRect rect) const;
     
     int paintDrawBuffer(LayerGeometryProvider *v, int w, int h,
                         const std::vector<int> &binforx,