comparison layer/SpectrogramLayer.h @ 1211:7a19738b9762 3.0-integration

Recreate FFT model when something changes, not the next time it's requested (avoids extra work when only retrieving the model)
author Chris Cannam
date Thu, 05 Jan 2017 11:10:57 +0000
parents c53ed1a6fcbd
children a1ee3108d1d3
comparison
equal deleted inserted replaced
1210:efc7586de499 1211:7a19738b9762
300 } 300 }
301 301
302 int getFFTOversampling() const; 302 int getFFTOversampling() const;
303 int getFFTSize() const; // m_windowSize * getFFTOversampling() 303 int getFFTSize() const; // m_windowSize * getFFTOversampling()
304 304
305 mutable FFTModel *m_fftModel; //!!! should not be mutable, see getFFTModel()? 305 FFTModel *m_fftModel;
306 mutable Dense3DModelPeakCache *m_peakCache; 306 FFTModel *getFFTModel() const { return m_fftModel; }
307 Dense3DModelPeakCache *m_peakCache;
308 Dense3DModelPeakCache *getPeakCache() const { return m_peakCache; }
307 const int m_peakCacheDivisor; 309 const int m_peakCacheDivisor;
310 void recreateFFTModel();
308 311
309 typedef std::map<int, MagnitudeRange> ViewMagMap; // key is view id 312 typedef std::map<int, MagnitudeRange> ViewMagMap; // key is view id
310 mutable ViewMagMap m_viewMags; 313 mutable ViewMagMap m_viewMags;
311 mutable ViewMagMap m_lastRenderedMags; // when in normalizeVisibleArea mode 314 mutable ViewMagMap m_lastRenderedMags; // when in normalizeVisibleArea mode
312 void invalidateMagnitudes(); 315 void invalidateMagnitudes();
314 typedef std::map<int, Colour3DPlotRenderer *> ViewRendererMap; // key is view id 317 typedef std::map<int, Colour3DPlotRenderer *> ViewRendererMap; // key is view id
315 mutable ViewRendererMap m_renderers; 318 mutable ViewRendererMap m_renderers;
316 Colour3DPlotRenderer *getRenderer(LayerGeometryProvider *) const; 319 Colour3DPlotRenderer *getRenderer(LayerGeometryProvider *) const;
317 void invalidateRenderers(); 320 void invalidateRenderers();
318 321
319 FFTModel *getFFTModel() const;
320 Dense3DModelPeakCache *getPeakCache() const;
321 void invalidateFFTModel();
322
323 void paintWithRenderer(LayerGeometryProvider *v, QPainter &paint, QRect rect) const; 322 void paintWithRenderer(LayerGeometryProvider *v, QPainter &paint, QRect rect) const;
324 323
325 void paintDetailedScale(LayerGeometryProvider *v, 324 void paintDetailedScale(LayerGeometryProvider *v,
326 QPainter &paint, QRect rect) const; 325 QPainter &paint, QRect rect) const;
327 void paintDetailedScalePhase(LayerGeometryProvider *v, 326 void paintDetailedScalePhase(LayerGeometryProvider *v,