comparison layer/SpectrogramLayer.h @ 130:10eec0da9efe last-cc-copyright

* Move the current DenseThreeDimensionalModel to EditableDenseThreeDimensionalModel (wow!), and make DTDM an abstract base * Move FFTFuzzyAdapter to FFTModel as a new subclass of DTDM
author Chris Cannam
date Mon, 31 Jul 2006 17:05:18 +0000
parents 33929e0c3c6b
children 9e6b3e239b9d
comparison
equal deleted inserted replaced
129:26d9d65e4941 130:10eec0da9efe
21 #include "base/RealTime.h" 21 #include "base/RealTime.h"
22 #include "base/Thread.h" 22 #include "base/Thread.h"
23 #include "base/PropertyContainer.h" 23 #include "base/PropertyContainer.h"
24 #include "data/model/PowerOfSqrtTwoZoomConstraint.h" 24 #include "data/model/PowerOfSqrtTwoZoomConstraint.h"
25 #include "data/model/DenseTimeValueModel.h" 25 #include "data/model/DenseTimeValueModel.h"
26 26 #include "data/model/FFTModel.h"
27 #include "data/fft/FFTFuzzyAdapter.h"
28 27
29 #include <QMutex> 28 #include <QMutex>
30 #include <QWaitCondition> 29 #include <QWaitCondition>
31 #include <QImage> 30 #include <QImage>
32 #include <QPixmap> 31 #include <QPixmap>
34 class View; 33 class View;
35 class QPainter; 34 class QPainter;
36 class QImage; 35 class QImage;
37 class QPixmap; 36 class QPixmap;
38 class QTimer; 37 class QTimer;
39 class FFTFuzzyAdapter; 38 class FFTModel;
40 39
41 40
42 /** 41 /**
43 * SpectrogramLayer represents waveform data (obtained from a 42 * SpectrogramLayer represents waveform data (obtained from a
44 * DenseTimeValueModel) in spectrogram form. 43 * DenseTimeValueModel) in spectrogram form.
320 else return m_windowSize / (1 << (m_windowHopLevel - 1)); 319 else return m_windowSize / (1 << (m_windowHopLevel - 1));
321 } 320 }
322 321
323 size_t getZeroPadLevel(const View *v) const; 322 size_t getZeroPadLevel(const View *v) const;
324 size_t getFFTSize(const View *v) const; 323 size_t getFFTSize(const View *v) const;
325 FFTFuzzyAdapter *getFFTAdapter(const View *v) const; 324 FFTModel *getFFTModel(const View *v) const;
326 void invalidateFFTAdapters(); 325 void invalidateFFTModels();
327 326
328 typedef std::pair<FFTFuzzyAdapter *, int> FFTFillPair; // adapter, last fill 327 typedef std::pair<FFTModel *, int> FFTFillPair; // model, last fill
329 typedef std::map<const View *, FFTFillPair> ViewFFTMap; 328 typedef std::map<const View *, FFTFillPair> ViewFFTMap;
330 typedef std::vector<float> FloatVector; 329 typedef std::vector<float> FloatVector;
331 mutable ViewFFTMap m_fftAdapters; 330 mutable ViewFFTMap m_fftModels;
332 331
333 class MagnitudeRange { 332 class MagnitudeRange {
334 public: 333 public:
335 MagnitudeRange() : m_min(0), m_max(0) { } 334 MagnitudeRange() : m_min(0), m_max(0) { }
336 bool operator==(const MagnitudeRange &r) { 335 bool operator==(const MagnitudeRange &r) {