comparison layer/SpectrogramLayer.h @ 1085:179ea8a2f650 spectrogram-minor-refactor

Add VerticalBinLayer to SpectrogramLayer
author Chris Cannam
date Fri, 01 Jul 2016 17:54:31 +0100
parents cb4c9fb37ddc
children 163cb9b98104
comparison
equal deleted inserted replaced
1084:db976e9f385a 1085:179ea8a2f650
25 #include "data/model/PowerOfSqrtTwoZoomConstraint.h" 25 #include "data/model/PowerOfSqrtTwoZoomConstraint.h"
26 #include "data/model/DenseTimeValueModel.h" 26 #include "data/model/DenseTimeValueModel.h"
27 #include "data/model/FFTModel.h" 27 #include "data/model/FFTModel.h"
28 28
29 #include "ScrollableImageCache.h" 29 #include "ScrollableImageCache.h"
30 #include "VerticalBinLayer.h"
30 31
31 #include <QMutex> 32 #include <QMutex>
32 #include <QWaitCondition> 33 #include <QWaitCondition>
33 #include <QImage> 34 #include <QImage>
34 #include <QPixmap> 35 #include <QPixmap>
46 * SpectrogramLayer represents waveform data (obtained from a 47 * SpectrogramLayer represents waveform data (obtained from a
47 * DenseTimeValueModel) in spectrogram form. 48 * DenseTimeValueModel) in spectrogram form.
48 */ 49 */
49 50
50 class SpectrogramLayer : public SliceableLayer, 51 class SpectrogramLayer : public SliceableLayer,
52 public VerticalBinLayer,
51 public PowerOfSqrtTwoZoomConstraint 53 public PowerOfSqrtTwoZoomConstraint
52 { 54 {
53 Q_OBJECT 55 Q_OBJECT
54 56
55 public: 57 public:
206 } 208 }
207 209
208 double getYForFrequency(const LayerGeometryProvider *v, double frequency) const; 210 double getYForFrequency(const LayerGeometryProvider *v, double frequency) const;
209 double getFrequencyForY(const LayerGeometryProvider *v, int y) const; 211 double getFrequencyForY(const LayerGeometryProvider *v, int y) const;
210 212
213 //!!! VerticalBinLayer methods. Note overlap with get*BinRange()
214 double getYForBin(LayerGeometryProvider *, double bin) const;
215 double getBinForY(LayerGeometryProvider *, double y) const;
216
211 virtual int getCompletion(LayerGeometryProvider *v) const; 217 virtual int getCompletion(LayerGeometryProvider *v) const;
212 virtual QString getError(LayerGeometryProvider *v) const; 218 virtual QString getError(LayerGeometryProvider *v) const;
213 219
214 virtual bool getValueExtents(double &min, double &max, 220 virtual bool getValueExtents(double &min, double &max,
215 bool &logarithmic, QString &unit) const; 221 bool &logarithmic, QString &unit) const;