1 #include <boost/shared_ptr.hpp>
3 #include "pbd/properties.h"
5 #include "ardour/types.h"
7 #include <glibmm/refptr.h>
9 #include "canvas/item.h"
10 #include "canvas/fill.h"
11 #include "canvas/outline.h"
23 namespace ArdourCanvas {
25 class WaveView : virtual public Item, public Outline, public Fill
28 WaveView (Group *, boost::shared_ptr<ARDOUR::AudioRegion>);
30 void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const;
31 void compute_bounding_box () const;
33 XMLNode* get_state () const;
34 void set_state (XMLNode const *);
36 void set_frames_per_pixel (double);
37 void set_height (Distance);
38 void set_channel (int);
39 void set_region_start (ARDOUR::frameoffset_t);
41 void region_resized ();
46 #ifdef CANVAS_COMPATIBILITY
47 void*& property_gain_src () {
50 void*& property_gain_function () {
53 bool& property_rectified () {
56 bool& property_logscaled () {
59 double& property_amplitude_above_axis () {
62 Color& property_clip_color () {
65 Color& property_zero_color () {
80 CacheEntry (WaveView const *, int, int);
91 ARDOUR::PeakData* peaks () const {
95 Glib::RefPtr<Gdk::Pixbuf> pixbuf ();
99 Coord position (float) const;
101 WaveView const * _wave_view;
105 ARDOUR::PeakData* _peaks;
106 Glib::RefPtr<Gdk::Pixbuf> _pixbuf;
109 friend class CacheEntry;
110 friend class ::WaveViewTest;
112 void invalidate_whole_cache ();
113 void invalidate_pixbuf_cache ();
115 boost::shared_ptr<ARDOUR::AudioRegion> _region;
117 double _frames_per_pixel;
120 /** The `start' value to use for the region; we can't use the region's
121 * value as the crossfade editor needs to alter it.
123 ARDOUR::frameoffset_t _region_start;
125 mutable std::list<CacheEntry*> _cache;