X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fcanvas%2Fcanvas%2Fwave_view.h;h=f26c3a5c104dfeb8c1ee6d31d973406b303943ad;hb=c4c7598adbc9e5eca5fe04a23bb7e88fc0989f34;hp=6327277ef40c3923fe85da77418b3cb31856a57d;hpb=c22e96522d9275db4b1b4ba8edddbda5e7f798b9;p=ardour.git diff --git a/libs/canvas/canvas/wave_view.h b/libs/canvas/canvas/wave_view.h index 6327277ef4..f26c3a5c10 100644 --- a/libs/canvas/canvas/wave_view.h +++ b/libs/canvas/canvas/wave_view.h @@ -45,7 +45,7 @@ class WaveViewTest; namespace ArdourCanvas { -class LIBCANVAS_API WaveView : virtual public Item, public Outline, public Fill +class LIBCANVAS_API WaveView : public Item { public: @@ -53,19 +53,24 @@ public: Normal, Rectified }; - + struct CacheEntry { int channel; Coord height; float amplitude; + Color fill_color; framepos_t start; framepos_t end; Cairo::RefPtr image; - CacheEntry() : - channel (0), height (0), amplitude(0), start (0), end (0), image (0) {} - CacheEntry(int chan, Coord hght, float amp, framepos_t strt, framepos_t ed, Cairo::RefPtr img) : - channel (chan), height (hght), amplitude (amp), start (strt), end (ed), image (img) {} + + CacheEntry(int chan, Coord hght, float amp, Color fcl, framepos_t strt, framepos_t ed, Cairo::RefPtr img) : + + channel (chan), height (hght), amplitude (amp), fill_color (fcl), + start (strt), end (ed), image (img) {} }; + + /* final ImageSurface rendered with colours */ + Cairo::RefPtr _image; /* Displays a single channel of waveform data for the given Region. @@ -86,7 +91,8 @@ public: */ - WaveView (Group *, boost::shared_ptr); + WaveView (Canvas *, boost::shared_ptr); + WaveView (Item*, boost::shared_ptr); ~WaveView (); void render (Rect const & area, Cairo::RefPtr) const; @@ -186,7 +192,7 @@ private: void get_image (Cairo::RefPtr& image, framepos_t start, framepos_t end, double& image_offset) const; - ArdourCanvas::Coord y_extent (double) const; + ArdourCanvas::Coord y_extent (double, bool) const; void draw_image (Cairo::RefPtr&, ARDOUR::PeakData*, int) const; };