~ubuntu-branches/ubuntu/utopic/ardour3/utopic

« back to all changes in this revision

Viewing changes to gtk2_ardour/editor_summary.h

  • Committer: Package Import Robot
  • Author(s): Felipe Sateler
  • Date: 2013-09-21 19:05:02 UTC
  • Revision ID: package-import@ubuntu.com-20130921190502-8gsftrku6jnzhd7v
Tags: upstream-3.4~dfsg
ImportĀ upstreamĀ versionĀ 3.4~dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 "gtkmm2ext/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, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList
 
36
{
 
37
public:
 
38
        EditorSummary (Editor *);
 
39
 
 
40
        void set_session (ARDOUR::Session *);
 
41
        void set_overlays_dirty ();
 
42
        void routes_added (std::list<RouteTimeAxisView*> const &);
 
43
 
 
44
private:
 
45
 
 
46
        enum Position {
 
47
                LEFT,
 
48
                LEFT_TOP,
 
49
                TOP,
 
50
                RIGHT_TOP,
 
51
                RIGHT,
 
52
                RIGHT_BOTTOM,
 
53
                BOTTOM,
 
54
                LEFT_BOTTOM,
 
55
                INSIDE,
 
56
                BELOW_OR_ABOVE,
 
57
                TO_LEFT_OR_RIGHT,
 
58
                OTHERWISE_OUTSIDE
 
59
        };
 
60
      
 
61
        void on_size_request (Gtk::Requisition *);
 
62
        bool on_button_press_event (GdkEventButton *);
 
63
        bool on_button_release_event (GdkEventButton *);
 
64
        bool on_motion_notify_event (GdkEventMotion *);
 
65
        bool on_scroll_event (GdkEventScroll *);
 
66
        bool on_key_press_event (GdkEventKey*);
 
67
        bool on_key_release_event (GdkEventKey*);
 
68
        bool on_enter_notify_event (GdkEventCrossing*); 
 
69
        bool on_leave_notify_event (GdkEventCrossing*); 
 
70
 
 
71
        void centre_on_click (GdkEventButton *);
 
72
        void render (cairo_t *);
 
73
        void render_region (RegionView*, cairo_t*, double) const;
 
74
        void get_editor (std::pair<double, double> *, std::pair<double, double> *) const;
 
75
        void set_editor (double, double);
 
76
        void set_editor (std::pair<double, double>, double);
 
77
        void set_editor (std::pair<double, double>, std::pair<double, double>);
 
78
        void set_editor_x (double);
 
79
        void set_editor_x (std::pair<double, double>);
 
80
        void set_editor_y (double);
 
81
        void set_editor_y (std::pair<double, double>);
 
82
        void playhead_position_changed (framepos_t);
 
83
        double summary_y_to_editor (double) const;
 
84
        double editor_y_to_summary (double) const;
 
85
        Position get_position (double, double) const;
 
86
        void set_cursor (Position);
 
87
        void route_gui_changed (std::string);
 
88
        bool suspending_editor_updates () const;
 
89
        double playhead_frame_to_position (framepos_t) const;
 
90
        framepos_t position_to_playhead_frame_to_position (double pos) const;
 
91
        void set_overlays_dirty (int, int, int, int);
 
92
 
 
93
        framepos_t _start; ///< start frame of the overview
 
94
        framepos_t _end; ///< end frame of the overview
 
95
 
 
96
        /** fraction of the session length by which the overview size should extend past the start and end markers */
 
97
        double _overhang_fraction;
 
98
 
 
99
        double _x_scale; ///< pixels per frame for the x axis of the pixmap
 
100
        double _track_height;
 
101
        double _last_playhead;
 
102
 
 
103
        std::pair<double, double> _start_editor_x;
 
104
        std::pair<double, double> _start_editor_y;
 
105
        double _start_mouse_x;
 
106
        double _start_mouse_y;
 
107
 
 
108
        Position _start_position;
 
109
 
 
110
        bool _move_dragging;
 
111
        bool _moved;
 
112
        std::pair<double, double> _view_rectangle_x;
 
113
        std::pair<double, double> _view_rectangle_y;
 
114
 
 
115
        std::pair<double, double> _pending_editor_x;
 
116
        std::pair<double, double> _pending_editor_y;
 
117
        bool _pending_editor_changed;
 
118
 
 
119
        bool _zoom_dragging;
 
120
        Position _zoom_position;
 
121
 
 
122
        bool _old_follow_playhead;
 
123
 
 
124
        PBD::ScopedConnectionList position_connection;
 
125
        PBD::ScopedConnection route_ctrl_id_connection;
 
126
        PBD::ScopedConnectionList region_property_connection;
 
127
};
 
128
 
 
129
#endif