diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-24 15:42:14 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-24 15:42:14 -0400 |
commit | 6f664c1f67f9a62d44b3ee8c3cae8c341e0731d3 (patch) | |
tree | 88133cd525135ef198b7bf9c4a7f1081826a5ac5 /libs/canvas/canvas/wave_view.h | |
parent | b36e085001cabc13f20f6b6779d08d9816d76b00 (diff) |
many pervasive changes primarily related to waveform drawing, particular content-dragging, colors, and more
Diffstat (limited to 'libs/canvas/canvas/wave_view.h')
-rw-r--r-- | libs/canvas/canvas/wave_view.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/libs/canvas/canvas/wave_view.h b/libs/canvas/canvas/wave_view.h index f88ca41ba4..b75b8c5312 100644 --- a/libs/canvas/canvas/wave_view.h +++ b/libs/canvas/canvas/wave_view.h @@ -105,17 +105,31 @@ private: #endif + /** A cached, pre-rendered image of some section of a waveform. + + It spans a range given relative to the start of the source + of the waveform data, so a range from N..M corresponds + to the sample range N..M within the source. + + Invalidated by a changes to: + + samples_per_pixel + colors + height + + */ + class CacheEntry { - public: - CacheEntry (WaveView const *, int, int); + public: + CacheEntry (WaveView const *, double, double, int); ~CacheEntry (); - int start () const { + double start () const { return _start; } - int end () const { + double end () const { return _end; } @@ -130,9 +144,11 @@ private: Coord position (Coord) const; WaveView const * _wave_view; - int _start; - int _end; - int _n_peaks; + + double _start; + double _end; + int _n_peaks; + boost::shared_array<ARDOUR::PeakData> _peaks; Cairo::RefPtr<Cairo::ImageSurface> _image; }; @@ -163,7 +179,7 @@ private: * value as the crossfade editor needs to alter it. */ ARDOUR::frameoffset_t _region_start; - + mutable std::list<CacheEntry*> _cache; PBD::ScopedConnection invalidation_connection; |