Mercurial > hg > svgui
comparison layer/SpectrogramLayer.h @ 477:92f4d88241b8
* some preparatory reorganisation
author | Chris Cannam |
---|---|
date | Tue, 03 Feb 2009 11:19:39 +0000 |
parents | 2ed4e572d0d4 |
children | 0990b95140e3 |
comparison
equal
deleted
inserted
replaced
476:2613bc1b2823 | 477:92f4d88241b8 |
---|---|
281 QColor m_colours[256]; | 281 QColor m_colours[256]; |
282 }; | 282 }; |
283 | 283 |
284 Palette m_palette; | 284 Palette m_palette; |
285 | 285 |
286 /** | |
287 * PixmapCache covers the area of the view, at view resolution. | |
288 * Not all of it is necessarily valid at once (it is refreshed | |
289 * in parts when scrolling, for example). | |
290 */ | |
286 struct PixmapCache | 291 struct PixmapCache |
287 { | 292 { |
288 QPixmap pixmap; | 293 QPixmap pixmap; |
289 QRect validArea; | 294 QRect validArea; |
290 long startFrame; | 295 long startFrame; |
292 }; | 297 }; |
293 typedef std::map<const View *, PixmapCache> ViewPixmapCache; | 298 typedef std::map<const View *, PixmapCache> ViewPixmapCache; |
294 void invalidatePixmapCaches(); | 299 void invalidatePixmapCaches(); |
295 void invalidatePixmapCaches(size_t startFrame, size_t endFrame); | 300 void invalidatePixmapCaches(size_t startFrame, size_t endFrame); |
296 mutable ViewPixmapCache m_pixmapCaches; | 301 mutable ViewPixmapCache m_pixmapCaches; |
302 | |
303 /** | |
304 * When painting, we draw directly onto the draw buffer and then | |
305 * copy this to the part of the pixmap cache that needed refreshing | |
306 * before copying the pixmap cache onto the window. (Remind me why | |
307 * we don't draw directly onto the cache?) | |
308 */ | |
297 mutable QImage m_drawBuffer; | 309 mutable QImage m_drawBuffer; |
298 | 310 |
299 mutable QTimer *m_updateTimer; | 311 mutable QTimer *m_updateTimer; |
300 | 312 |
301 mutable size_t m_candidateFillStartFrame; | 313 mutable size_t m_candidateFillStartFrame; |
399 typedef std::map<const View *, MagnitudeRange> ViewMagMap; | 411 typedef std::map<const View *, MagnitudeRange> ViewMagMap; |
400 mutable ViewMagMap m_viewMags; | 412 mutable ViewMagMap m_viewMags; |
401 mutable std::vector<MagnitudeRange> m_columnMags; | 413 mutable std::vector<MagnitudeRange> m_columnMags; |
402 void invalidateMagnitudes(); | 414 void invalidateMagnitudes(); |
403 bool updateViewMagnitudes(View *v) const; | 415 bool updateViewMagnitudes(View *v) const; |
416 bool getColumnValues(View *v, FFTModel *fft, int x0, int x, | |
417 int minbin, int maxbin, | |
418 float displayMinFreq, float displayMaxFreq, | |
419 const int h, | |
420 const float *yforbin, float *yval) const; | |
404 | 421 |
405 virtual void updateMeasureRectYCoords(View *v, const MeasureRect &r) const; | 422 virtual void updateMeasureRectYCoords(View *v, const MeasureRect &r) const; |
406 virtual void setMeasureRectYCoord(View *v, MeasureRect &r, bool start, int y) const; | 423 virtual void setMeasureRectYCoord(View *v, MeasureRect &r, bool start, int y) const; |
407 }; | 424 }; |
408 | 425 |