73fb42611c13ffe6f3889b0ae18eaecd8aec9006
[ardour.git] / gtk2_ardour / editor_summary.h
1 #ifndef __gtk_ardour_editor_summary_h__
2 #define __gtk_ardour_editor_summary_h__
3
4 #include <gtkmm/eventbox.h>
5
6 namespace ARDOUR {
7         class Session;
8 }
9
10 class Editor;
11
12 /** Class to provide a visual summary of the contents of an editor window; represents
13  *  the whole session as a set of lines, one per region view.
14  */
15 class EditorSummary : public Gtk::EventBox
16 {
17 public:
18         EditorSummary (Editor *);
19         ~EditorSummary ();
20
21         void set_session (ARDOUR::Session *);
22         void set_dirty ();
23         void set_bounds_dirty ();
24
25 private:
26         bool on_expose_event (GdkEventExpose *);
27         void on_size_request (Gtk::Requisition *);
28         void on_size_allocate (Gtk::Allocation &);
29         bool on_button_press_event (GdkEventButton *);
30         bool on_button_release_event (GdkEventButton *);
31         bool on_motion_notify_event (GdkEventMotion *);
32
33         void render (cairo_t *);
34         GdkPixmap* get_pixmap (GdkDrawable *);
35         void render_region (RegionView*, cairo_t*, nframes_t, double) const;
36         void editor_view (std::pair<double, double> *, std::pair<double, double> *) const;
37
38         Editor* _editor; ///< our editor
39         ARDOUR::Session* _session; ///< our session
40         GdkPixmap* _pixmap; ///< pixmap containing a rendering of the region views, or 0
41         bool _regions_dirty; ///< true if _pixmap requires re-rendering, otherwise false
42         int _width; ///< pixmap width
43         int _height; ///< pixmap height
44         double _pixels_per_frame; ///< pixels per frame for the x axis of the pixmap
45         double _vertical_scale;
46         bool _dragging;
47         double _x_offset;
48         double _y_offset;
49 };
50
51 #endif