Strip trailing whitespace and fix other whitespace errors (e.g. space/tab mixing...
[ardour.git] / gtk2_ardour / editor_summary.h
1 /*
2     Copyright (C) 2009 Paul Davis
3
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.
8
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.
13
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.
17
18 */
19
20 #ifndef __gtk_ardour_editor_summary_h__
21 #define __gtk_ardour_editor_summary_h__
22
23 #include "cairo_widget.h"
24 #include "editor_component.h"
25
26 namespace ARDOUR {
27         class Session;
28 }
29
30 class Editor;
31
32 /** Class to provide a visual summary of the contents of an editor window; represents
33  *  the whole session as a set of lines, one per region view.
34  */
35 class EditorSummary : public CairoWidget, public EditorComponent
36 {
37 public:
38         EditorSummary (Editor *);
39
40         void connect_to_session (ARDOUR::Session *);
41         void set_overlays_dirty ();
42
43 private:
44         bool on_expose_event (GdkEventExpose *);
45         void on_size_request (Gtk::Requisition *);
46         bool on_button_press_event (GdkEventButton *);
47         bool on_button_release_event (GdkEventButton *);
48         bool on_motion_notify_event (GdkEventMotion *);
49         bool on_scroll_event (GdkEventScroll *);
50
51         void centre_on_click (GdkEventButton *);
52         void render (cairo_t *);
53         void render_region (RegionView*, cairo_t*, nframes_t, double) const;
54         void get_editor (std::pair<double, double> *, std::pair<double, double> *) const;
55         void set_editor (std::pair<double, double> const &, std::pair<double, double> const &);
56         void playhead_position_changed (nframes64_t);
57
58         double _x_scale; ///< pixels per frame for the x axis of the pixmap
59         double _y_scale;
60         double _last_playhead;
61
62         std::pair<double, double> _start_editor_x;
63         std::pair<double, double> _start_editor_y;
64         double _start_mouse_x;
65         double _start_mouse_y;
66
67         bool _move_dragging;
68         double _x_offset;
69         double _y_offset;
70         bool _moved;
71
72         bool _zoom_dragging;
73         bool _zoom_left;
74 };
75
76 #endif