summaryrefslogtreecommitdiff
path: root/libs/canvas/canvas/wave_view.h
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-06-20 14:37:31 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2013-06-20 14:37:31 -0400
commit27c943f1ddca0890ac2e5547b249334e0266c0a5 (patch)
treefd3c1c6b4421cfbf720d3a91ab58141461446017 /libs/canvas/canvas/wave_view.h
parent3604bf12a2806b2a21b4ac6a1776fa55ed7963b4 (diff)
new image cache design for waveviews, with various fixes.
Rather than maintain a set of images in a cache, when we no longer have the required waveform data, create a new image that is appropriately centered and extends to roughly twice the screen width (or the limits of the region's source file(s), as necessary)
Diffstat (limited to 'libs/canvas/canvas/wave_view.h')
-rw-r--r--libs/canvas/canvas/wave_view.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/libs/canvas/canvas/wave_view.h b/libs/canvas/canvas/wave_view.h
index e4e9d9b7ed..78c6486fce 100644
--- a/libs/canvas/canvas/wave_view.h
+++ b/libs/canvas/canvas/wave_view.h
@@ -71,6 +71,7 @@ public:
WaveView (Group *, boost::shared_ptr<ARDOUR::AudioRegion>);
+ ~WaveView ();
void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const;
void compute_bounding_box () const;
@@ -141,7 +142,7 @@ private:
class CacheEntry
{
public:
- CacheEntry (WaveView const *, double, double);
+ CacheEntry (WaveView const *, double, double, ARDOUR::framepos_t, ARDOUR::framepos_t);
~CacheEntry ();
double pixel_start () const {
@@ -171,7 +172,7 @@ private:
Coord position (Coord) const;
WaveView const * _wave_view;
-
+
double _pixel_start;
double _pixel_end;
ARDOUR::framecnt_t _sample_start;
@@ -208,8 +209,8 @@ private:
* value as the crossfade editor needs to alter it.
*/
ARDOUR::frameoffset_t _region_start;
-
- mutable std::list<CacheEntry*> _cache;
+
+ mutable CacheEntry* _cache;
PBD::ScopedConnection invalidation_connection;
@@ -220,6 +221,8 @@ private:
static PBD::Signal0<void> VisualPropertiesChanged;
void handle_visual_property_change ();
+ void ensure_cache (ARDOUR::framecnt_t pixel_start, ARDOUR::framecnt_t pixel_end,
+ ARDOUR::framepos_t sample_start, ARDOUR::framepos_t sample_end) const;
};
}