3 Copyright (C) 2009 Paul Davis
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __gtk_ardour_editor_summary_h__
22 #define __gtk_ardour_editor_summary_h__
24 #include "cairo_widget.h"
25 #include "editor_component.h"
33 /** Class to provide a visual summary of the contents of an editor window; represents
34 * the whole session as a set of lines, one per region view.
36 class EditorSummary : public CairoWidget, public EditorComponent
39 EditorSummary (Editor *);
41 void set_session (ARDOUR::Session *);
42 void set_overlays_dirty ();
45 bool on_expose_event (GdkEventExpose *);
46 void on_size_request (Gtk::Requisition *);
47 bool on_button_press_event (GdkEventButton *);
48 bool on_button_release_event (GdkEventButton *);
49 bool on_motion_notify_event (GdkEventMotion *);
50 bool on_scroll_event (GdkEventScroll *);
52 void centre_on_click (GdkEventButton *);
53 void render (cairo_t *);
54 void render_region (RegionView*, cairo_t*, double) const;
55 void get_editor (std::pair<double, double> *, std::pair<double, double> *) const;
56 void set_editor (std::pair<double, double> const &, std::pair<double, double> const &);
57 void playhead_position_changed (nframes64_t);
59 nframes_t _start; ///< start frame of the overview
60 nframes_t _end; ///< end frame of the overview
62 /** fraction of the session length by which the overview size should extend past the start and end markers */
63 double _overhang_fraction;
65 double _x_scale; ///< pixels per frame for the x axis of the pixmap
67 double _last_playhead;
69 std::pair<double, double> _start_editor_x;
70 std::pair<double, double> _start_editor_y;
71 double _start_mouse_x;
72 double _start_mouse_y;
75 BELOW_OR_ABOVE_VIEWBOX,
76 TO_LEFT_OR_RIGHT_OF_VIEWBOX
87 PBD::ScopedConnectionList position_connection;
88 PBD::ScopedConnectionList region_property_connection;