Mercurial > hg > svgui
comparison 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 |
comparison
equal
deleted
inserted
replaced
1087:6d990a24ac1b | 1088:c520f90bbf2e |
---|---|
337 else return m_windowSize / (1 << (m_windowHopLevel - 1)); | 337 else return m_windowSize / (1 << (m_windowHopLevel - 1)); |
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 FFTModel *getFFTModel(const LayerGeometryProvider *v) const; | 343 mutable FFTModel *m_fftModel; //!!! should not be mutable, see getFFTModel() |
344 Dense3DModelPeakCache *getPeakCache(const LayerGeometryProvider *v) const; | 344 mutable Dense3DModelPeakCache *m_peakCache; |
345 void invalidateFFTModels(); | |
346 | |
347 typedef std::map<int, FFTModel *> ViewFFTMap; // key is view id | |
348 typedef std::map<int, Dense3DModelPeakCache *> PeakCacheMap; // key is view id | |
349 mutable ViewFFTMap m_fftModels; | |
350 mutable PeakCacheMap m_peakCaches; | |
351 const int m_peakCacheDivisor; | 345 const int m_peakCacheDivisor; |
352 mutable Model *m_sliceableModel; | |
353 | 346 |
354 typedef std::map<int, MagnitudeRange> ViewMagMap; // key is view id | 347 typedef std::map<int, MagnitudeRange> ViewMagMap; // key is view id |
355 mutable ViewMagMap m_viewMags; | 348 mutable ViewMagMap m_viewMags; |
356 mutable std::vector<MagnitudeRange> m_columnMags; | 349 mutable std::vector<MagnitudeRange> m_columnMags; |
357 void invalidateMagnitudes(); | 350 void invalidateMagnitudes(); |
358 bool updateViewMagnitudes(LayerGeometryProvider *v) const; | 351 bool updateViewMagnitudes(LayerGeometryProvider *v) const; |
352 | |
353 FFTModel *getFFTModel() const; | |
354 Dense3DModelPeakCache *getPeakCache() const; | |
355 void invalidateFFTModel(); | |
359 | 356 |
360 int paintDrawBuffer(LayerGeometryProvider *v, int w, int h, | 357 int paintDrawBuffer(LayerGeometryProvider *v, int w, int h, |
361 const std::vector<int> &binforx, | 358 const std::vector<int> &binforx, |
362 const std::vector<double> &binfory, | 359 const std::vector<double> &binfory, |
363 bool usePeaksCache, | 360 bool usePeaksCache, |