comparison 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
comparison
equal deleted inserted replaced
1088:c520f90bbf2e 1089:c8683d94442a
39 class QImage; 39 class QImage;
40 class QPixmap; 40 class QPixmap;
41 class QTimer; 41 class QTimer;
42 class FFTModel; 42 class FFTModel;
43 class Dense3DModelPeakCache; 43 class Dense3DModelPeakCache;
44 44 class Colour3DPlotRenderer;
45 45
46 /** 46 /**
47 * SpectrogramLayer represents waveform data (obtained from a 47 * SpectrogramLayer represents waveform data (obtained from a
48 * DenseTimeValueModel) in spectrogram form. 48 * DenseTimeValueModel) in spectrogram form.
49 */ 49 */
338 } 338 }
339 339
340 int getFFTOversampling() const; 340 int getFFTOversampling() const;
341 int getFFTSize() const; // m_windowSize * getFFTOversampling() 341 int getFFTSize() const; // m_windowSize * getFFTOversampling()
342 342
343 mutable FFTModel *m_fftModel; //!!! should not be mutable, see getFFTModel() 343 mutable FFTModel *m_fftModel; //!!! should not be mutable, see getFFTModel()?
344 mutable Dense3DModelPeakCache *m_peakCache; 344 mutable Dense3DModelPeakCache *m_peakCache;
345 const int m_peakCacheDivisor; 345 const int m_peakCacheDivisor;
346 346
347 typedef std::map<int, MagnitudeRange> ViewMagMap; // key is view id 347 typedef std::map<int, MagnitudeRange> ViewMagMap; // key is view id
348 mutable ViewMagMap m_viewMags; 348 mutable ViewMagMap m_viewMags;
349 mutable std::vector<MagnitudeRange> m_columnMags; 349 mutable std::vector<MagnitudeRange> m_columnMags;
350 void invalidateMagnitudes(); 350 void invalidateMagnitudes();
351 bool updateViewMagnitudes(LayerGeometryProvider *v) const; 351 bool updateViewMagnitudes(LayerGeometryProvider *v) const;
352
353 typedef std::map<int, Colour3DPlotRenderer *> ViewRendererMap; // key is view id
354 mutable ViewRendererMap m_renderers;
355 Colour3DPlotRenderer *getRenderer(LayerGeometryProvider *) const;
352 356
353 FFTModel *getFFTModel() const; 357 FFTModel *getFFTModel() const;
354 Dense3DModelPeakCache *getPeakCache() const; 358 Dense3DModelPeakCache *getPeakCache() const;
355 void invalidateFFTModel(); 359 void invalidateFFTModel();
360
361 void paintAlternative(LayerGeometryProvider *v, QPainter &paint, QRect rect) const;
356 362
357 int paintDrawBuffer(LayerGeometryProvider *v, int w, int h, 363 int paintDrawBuffer(LayerGeometryProvider *v, int w, int h,
358 const std::vector<int> &binforx, 364 const std::vector<int> &binforx,
359 const std::vector<double> &binfory, 365 const std::vector<double> &binfory,
360 bool usePeaksCache, 366 bool usePeaksCache,