2 Copyright (C) 2009 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __gtk_ardour_editor_summary_h__
21 #define __gtk_ardour_editor_summary_h__
23 #include <gtkmm/eventbox.h>
31 /** Class to provide a visual summary of the contents of an editor window; represents
32 * the whole session as a set of lines, one per region view.
34 class EditorSummary : public Gtk::EventBox
37 EditorSummary (Editor *);
40 void set_session (ARDOUR::Session *);
42 void set_overlays_dirty ();
45 void centre_on_click (GdkEventButton *);
46 bool on_expose_event (GdkEventExpose *);
47 void on_size_request (Gtk::Requisition *);
48 void on_size_allocate (Gtk::Allocation &);
49 bool on_button_press_event (GdkEventButton *);
50 bool on_button_release_event (GdkEventButton *);
51 bool on_motion_notify_event (GdkEventMotion *);
52 bool on_scroll_event (GdkEventScroll *);
54 void render (cairo_t *);
55 GdkPixmap* get_pixmap (GdkDrawable *);
56 void render_region (RegionView*, cairo_t*, nframes_t, double) const;
57 void get_editor (std::pair<double, double> *, std::pair<double, double> *) const;
58 void set_editor (std::pair<double, double> const &, std::pair<double, double> const &);
59 void playhead_position_changed (nframes64_t);
61 Editor* _editor; ///< our editor
62 ARDOUR::Session* _session; ///< our session
63 GdkPixmap* _pixmap; ///< pixmap containing a rendering of the region views, or 0
64 bool _regions_dirty; ///< true if _pixmap requires re-rendering, otherwise false
65 int _width; ///< pixmap width
66 int _height; ///< pixmap height
67 double _x_scale; ///< pixels per frame for the x axis of the pixmap
69 double _last_playhead;
71 std::pair<double, double> _start_editor_x;
72 std::pair<double, double> _start_editor_y;
73 double _start_mouse_x;
74 double _start_mouse_y;