1 #include <boost/shared_ptr.hpp>
2 #include "pbd/properties.h"
3 #include "ardour/types.h"
4 #include "canvas/item.h"
5 #include "canvas/fill.h"
6 #include "canvas/outline.h"
14 namespace ArdourCanvas {
16 class WaveView : virtual public Item, public Outline, public Fill
19 WaveView (Group *, boost::shared_ptr<ARDOUR::AudioRegion>);
21 void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const;
22 void compute_bounding_box () const;
24 XMLNode* get_state () const;
25 void set_state (XMLNode const *);
27 void set_frames_per_pixel (double);
28 void set_height (Distance);
29 void set_channel (int);
30 void set_region_start (ARDOUR::frameoffset_t);
32 void region_resized ();
37 #ifdef CANVAS_COMPATIBILITY
38 void*& property_gain_src () {
41 void*& property_gain_function () {
44 bool& property_rectified () {
47 bool& property_logscaled () {
50 double& property_amplitude_above_axis () {
53 Color& property_clip_color () {
56 Color& property_zero_color () {
71 CacheEntry (WaveView const *, int, int);
82 ARDOUR::PeakData* peaks () const {
86 Glib::RefPtr<Gdk::Pixbuf> pixbuf ();
90 Coord position (float) const;
92 WaveView const * _wave_view;
96 ARDOUR::PeakData* _peaks;
97 Glib::RefPtr<Gdk::Pixbuf> _pixbuf;
100 friend class CacheEntry;
101 friend class ::WaveViewTest;
103 void invalidate_whole_cache ();
104 void invalidate_pixbuf_cache ();
106 boost::shared_ptr<ARDOUR::AudioRegion> _region;
108 double _frames_per_pixel;
111 /** The `start' value to use for the region; we can't use the region's
112 * value as the crossfade editor needs to alter it.
114 ARDOUR::frameoffset_t _region_start;
116 mutable std::list<CacheEntry*> _cache;