Mercurial > hg > svgui
comparison layer/SpectrogramLayer.h @ 805:1d526ba11a24 warnfix_no_size_t
Remove size_t's and fix warnings in layer/
author | Chris Cannam |
---|---|
date | Tue, 17 Jun 2014 15:18:06 +0100 |
parents | 67e6d518ac27 |
children | 4c8ca536b54f |
comparison
equal
deleted
inserted
replaced
782:ddae586bc47b | 805:1d526ba11a24 |
---|---|
68 virtual void paintCrosshairs(View *, QPainter &, QPoint) const; | 68 virtual void paintCrosshairs(View *, QPainter &, QPoint) const; |
69 | 69 |
70 virtual QString getFeatureDescription(View *v, QPoint &) const; | 70 virtual QString getFeatureDescription(View *v, QPoint &) const; |
71 | 71 |
72 virtual bool snapToFeatureFrame(View *v, int &frame, | 72 virtual bool snapToFeatureFrame(View *v, int &frame, |
73 size_t &resolution, | 73 int &resolution, |
74 SnapType snap) const; | 74 SnapType snap) const; |
75 | 75 |
76 virtual void measureDoubleClick(View *, QMouseEvent *); | 76 virtual void measureDoubleClick(View *, QMouseEvent *); |
77 | 77 |
78 virtual bool hasLightBackground() const; | 78 virtual bool hasLightBackground() const; |
97 * The default is channel 0. | 97 * The default is channel 0. |
98 */ | 98 */ |
99 void setChannel(int); | 99 void setChannel(int); |
100 int getChannel() const; | 100 int getChannel() const; |
101 | 101 |
102 void setWindowSize(size_t); | 102 void setWindowSize(int); |
103 size_t getWindowSize() const; | 103 int getWindowSize() const; |
104 | 104 |
105 void setWindowHopLevel(size_t level); | 105 void setWindowHopLevel(int level); |
106 size_t getWindowHopLevel() const; | 106 int getWindowHopLevel() const; |
107 | 107 |
108 void setWindowType(WindowType type); | 108 void setWindowType(WindowType type); |
109 WindowType getWindowType() const; | 109 WindowType getWindowType() const; |
110 | 110 |
111 void setZeroPadLevel(size_t level); | 111 void setZeroPadLevel(int level); |
112 size_t getZeroPadLevel() const; | 112 int getZeroPadLevel() const; |
113 | 113 |
114 /** | 114 /** |
115 * Set the gain multiplier for sample values in this view. | 115 * Set the gain multiplier for sample values in this view. |
116 * The default is 1.0. | 116 * The default is 1.0. |
117 */ | 117 */ |
125 * The default is 0.0. | 125 * The default is 0.0. |
126 */ | 126 */ |
127 void setThreshold(float threshold); | 127 void setThreshold(float threshold); |
128 float getThreshold() const; | 128 float getThreshold() const; |
129 | 129 |
130 void setMinFrequency(size_t); | 130 void setMinFrequency(int); |
131 size_t getMinFrequency() const; | 131 int getMinFrequency() const; |
132 | 132 |
133 void setMaxFrequency(size_t); // 0 -> no maximum | 133 void setMaxFrequency(int); // 0 -> no maximum |
134 size_t getMaxFrequency() const; | 134 int getMaxFrequency() const; |
135 | 135 |
136 enum ColourScale { | 136 enum ColourScale { |
137 LinearColourScale, | 137 LinearColourScale, |
138 MeterColourScale, | 138 MeterColourScale, |
139 dBSquaredColourScale, | 139 dBSquaredColourScale, |
241 | 241 |
242 virtual const Model *getSliceableModel() const; | 242 virtual const Model *getSliceableModel() const; |
243 | 243 |
244 protected slots: | 244 protected slots: |
245 void cacheInvalid(); | 245 void cacheInvalid(); |
246 void cacheInvalid(size_t startFrame, size_t endFrame); | 246 void cacheInvalid(int startFrame, int endFrame); |
247 | 247 |
248 void preferenceChanged(PropertyContainer::PropertyName name); | 248 void preferenceChanged(PropertyContainer::PropertyName name); |
249 | 249 |
250 void fillTimerTimedOut(); | 250 void fillTimerTimedOut(); |
251 | 251 |
252 protected: | 252 protected: |
253 const DenseTimeValueModel *m_model; // I do not own this | 253 const DenseTimeValueModel *m_model; // I do not own this |
254 | 254 |
255 int m_channel; | 255 int m_channel; |
256 size_t m_windowSize; | 256 int m_windowSize; |
257 WindowType m_windowType; | 257 WindowType m_windowType; |
258 size_t m_windowHopLevel; | 258 int m_windowHopLevel; |
259 size_t m_zeroPadLevel; | 259 int m_zeroPadLevel; |
260 size_t m_fftSize; | 260 int m_fftSize; |
261 float m_gain; | 261 float m_gain; |
262 float m_initialGain; | 262 float m_initialGain; |
263 float m_threshold; | 263 float m_threshold; |
264 float m_initialThreshold; | 264 float m_initialThreshold; |
265 int m_colourRotation; | 265 int m_colourRotation; |
266 int m_initialRotation; | 266 int m_initialRotation; |
267 size_t m_minFrequency; | 267 int m_minFrequency; |
268 size_t m_maxFrequency; | 268 int m_maxFrequency; |
269 size_t m_initialMaxFrequency; | 269 int m_initialMaxFrequency; |
270 ColourScale m_colourScale; | 270 ColourScale m_colourScale; |
271 int m_colourMap; | 271 int m_colourMap; |
272 QColor m_crosshairColour; | 272 QColor m_crosshairColour; |
273 FrequencyScale m_frequencyScale; | 273 FrequencyScale m_frequencyScale; |
274 BinDisplay m_binDisplay; | 274 BinDisplay m_binDisplay; |
309 struct ImageCache | 309 struct ImageCache |
310 { | 310 { |
311 QImage image; | 311 QImage image; |
312 QRect validArea; | 312 QRect validArea; |
313 long startFrame; | 313 long startFrame; |
314 size_t zoomLevel; | 314 int zoomLevel; |
315 }; | 315 }; |
316 typedef std::map<const View *, ImageCache> ViewImageCache; | 316 typedef std::map<const View *, ImageCache> ViewImageCache; |
317 void invalidateImageCaches(); | 317 void invalidateImageCaches(); |
318 void invalidateImageCaches(size_t startFrame, size_t endFrame); | 318 void invalidateImageCaches(int startFrame, int endFrame); |
319 mutable ViewImageCache m_imageCaches; | 319 mutable ViewImageCache m_imageCaches; |
320 | 320 |
321 /** | 321 /** |
322 * When painting, we draw directly onto the draw buffer and then | 322 * When painting, we draw directly onto the draw buffer and then |
323 * copy this to the part of the image cache that needed refreshing | 323 * copy this to the part of the image cache that needed refreshing |
326 */ | 326 */ |
327 mutable QImage m_drawBuffer; | 327 mutable QImage m_drawBuffer; |
328 | 328 |
329 mutable QTimer *m_updateTimer; | 329 mutable QTimer *m_updateTimer; |
330 | 330 |
331 mutable size_t m_candidateFillStartFrame; | 331 mutable int m_candidateFillStartFrame; |
332 bool m_exiting; | 332 bool m_exiting; |
333 | 333 |
334 void initialisePalette(); | 334 void initialisePalette(); |
335 void rotatePalette(int distance); | 335 void rotatePalette(int distance); |
336 | 336 |
344 float getEffectiveMaxFrequency() const; | 344 float getEffectiveMaxFrequency() const; |
345 | 345 |
346 struct LayerRange { | 346 struct LayerRange { |
347 long startFrame; | 347 long startFrame; |
348 int zoomLevel; | 348 int zoomLevel; |
349 size_t modelStart; | 349 int modelStart; |
350 size_t modelEnd; | 350 int modelEnd; |
351 }; | 351 }; |
352 | 352 |
353 // Note that the getYBin... methods return the nominal bin in the | 353 // Note that the getYBin... methods return the nominal bin in the |
354 // un-smoothed spectrogram. This is not necessarily the same bin | 354 // un-smoothed spectrogram. This is not necessarily the same bin |
355 // as is pulled from the spectrogram and drawn at the given | 355 // as is pulled from the spectrogram and drawn at the given |
366 float &adjFreqMin, float &adjFreqMax) const; | 366 float &adjFreqMin, float &adjFreqMax) const; |
367 bool getXBinSourceRange(View *v, int x, RealTime &timeMin, RealTime &timeMax) const; | 367 bool getXBinSourceRange(View *v, int x, RealTime &timeMin, RealTime &timeMax) const; |
368 bool getXYBinSourceRange(View *v, int x, int y, float &min, float &max, | 368 bool getXYBinSourceRange(View *v, int x, int y, float &min, float &max, |
369 float &phaseMin, float &phaseMax) const; | 369 float &phaseMin, float &phaseMax) const; |
370 | 370 |
371 size_t getWindowIncrement() const { | 371 int getWindowIncrement() const { |
372 if (m_windowHopLevel == 0) return m_windowSize; | 372 if (m_windowHopLevel == 0) return m_windowSize; |
373 else if (m_windowHopLevel == 1) return (m_windowSize * 3) / 4; | 373 else if (m_windowHopLevel == 1) return (m_windowSize * 3) / 4; |
374 else return m_windowSize / (1 << (m_windowHopLevel - 1)); | 374 else return m_windowSize / (1 << (m_windowHopLevel - 1)); |
375 } | 375 } |
376 | 376 |
377 size_t getZeroPadLevel(const View *v) const; | 377 int getZeroPadLevel(const View *v) const; |
378 size_t getFFTSize(const View *v) const; | 378 int getFFTSize(const View *v) const; |
379 FFTModel *getFFTModel(const View *v) const; | 379 FFTModel *getFFTModel(const View *v) const; |
380 Dense3DModelPeakCache *getPeakCache(const View *v) const; | 380 Dense3DModelPeakCache *getPeakCache(const View *v) const; |
381 void invalidateFFTModels(); | 381 void invalidateFFTModels(); |
382 | 382 |
383 typedef std::pair<FFTModel *, int> FFTFillPair; // model, last fill | 383 typedef std::pair<FFTModel *, int> FFTFillPair; // model, last fill |