2009-06-15 18:45:05 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 2009 Paul Davis
|
2009-06-15 18:45:05 -04:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2009-06-10 21:05:01 -04:00
|
|
|
#ifndef __gtk_ardour_editor_summary_h__
|
|
|
|
#define __gtk_ardour_editor_summary_h__
|
|
|
|
|
2011-12-07 08:57:45 -05:00
|
|
|
#include "gtkmm2ext/cairo_widget.h"
|
2009-07-03 14:37:15 -04:00
|
|
|
#include "editor_component.h"
|
2009-06-10 21:05:01 -04:00
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class Session;
|
|
|
|
}
|
|
|
|
|
|
|
|
class Editor;
|
|
|
|
|
2009-06-11 10:49:20 -04:00
|
|
|
/** Class to provide a visual summary of the contents of an editor window; represents
|
|
|
|
* the whole session as a set of lines, one per region view.
|
|
|
|
*/
|
2011-01-07 21:35:35 -05:00
|
|
|
class EditorSummary : public CairoWidget, public EditorComponent, public ARDOUR::SessionHandlePtr, public PBD::ScopedConnectionList
|
2009-06-10 21:05:01 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
EditorSummary (Editor *);
|
2014-10-11 07:36:52 -04:00
|
|
|
~EditorSummary ();
|
2009-06-10 21:05:01 -04:00
|
|
|
|
2009-12-17 13:24:23 -05:00
|
|
|
void set_session (ARDOUR::Session *);
|
2009-06-16 20:29:56 -04:00
|
|
|
void set_overlays_dirty ();
|
2014-06-17 07:44:36 -04:00
|
|
|
void set_background_dirty ();
|
2011-01-07 21:35:35 -05:00
|
|
|
void routes_added (std::list<RouteTimeAxisView*> const &);
|
2009-06-10 21:05:01 -04:00
|
|
|
|
|
|
|
private:
|
2014-10-29 11:07:13 -04:00
|
|
|
void parameter_changed (std::string);
|
2014-06-17 07:44:36 -04:00
|
|
|
void on_size_allocate (Gtk::Allocation& alloc);
|
2010-06-17 20:05:44 -04:00
|
|
|
|
|
|
|
enum Position {
|
|
|
|
LEFT,
|
|
|
|
LEFT_TOP,
|
|
|
|
TOP,
|
|
|
|
RIGHT_TOP,
|
|
|
|
RIGHT,
|
|
|
|
RIGHT_BOTTOM,
|
|
|
|
BOTTOM,
|
|
|
|
LEFT_BOTTOM,
|
|
|
|
INSIDE,
|
|
|
|
BELOW_OR_ABOVE,
|
|
|
|
TO_LEFT_OR_RIGHT,
|
|
|
|
OTHERWISE_OUTSIDE
|
|
|
|
};
|
2015-10-04 14:51:05 -04:00
|
|
|
|
2009-06-10 21:05:01 -04:00
|
|
|
void on_size_request (Gtk::Requisition *);
|
|
|
|
bool on_button_press_event (GdkEventButton *);
|
2009-06-13 13:52:51 -04:00
|
|
|
bool on_button_release_event (GdkEventButton *);
|
|
|
|
bool on_motion_notify_event (GdkEventMotion *);
|
2009-06-15 18:45:05 -04:00
|
|
|
bool on_scroll_event (GdkEventScroll *);
|
2012-07-23 22:58:28 -04:00
|
|
|
bool on_key_press_event (GdkEventKey*);
|
|
|
|
bool on_key_release_event (GdkEventKey*);
|
2015-10-04 14:51:05 -04:00
|
|
|
bool on_enter_notify_event (GdkEventCrossing*);
|
|
|
|
bool on_leave_notify_event (GdkEventCrossing*);
|
2009-06-10 21:05:01 -04:00
|
|
|
|
2009-06-20 09:41:55 -04:00
|
|
|
void centre_on_click (GdkEventButton *);
|
2017-03-20 12:11:56 -04:00
|
|
|
void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
|
2009-11-25 08:44:57 -05:00
|
|
|
void render_region (RegionView*, cairo_t*, double) const;
|
2009-06-15 21:03:24 -04:00
|
|
|
void get_editor (std::pair<double, double> *, std::pair<double, double> *) const;
|
2011-04-11 14:48:44 -04:00
|
|
|
void set_editor (double, double);
|
2011-09-14 09:57:20 -04:00
|
|
|
void set_editor (std::pair<double, double>, double);
|
|
|
|
void set_editor (std::pair<double, double>, std::pair<double, double>);
|
2011-04-11 14:48:44 -04:00
|
|
|
void set_editor_x (double);
|
2011-09-14 09:57:20 -04:00
|
|
|
void set_editor_x (std::pair<double, double>);
|
2010-06-17 20:05:44 -04:00
|
|
|
void set_editor_y (double);
|
2011-09-14 09:57:20 -04:00
|
|
|
void set_editor_y (std::pair<double, double>);
|
2010-09-17 14:20:37 -04:00
|
|
|
void playhead_position_changed (framepos_t);
|
2010-06-15 13:37:44 -04:00
|
|
|
double summary_y_to_editor (double) const;
|
2010-06-15 19:36:40 -04:00
|
|
|
double editor_y_to_summary (double) const;
|
2010-06-17 20:05:44 -04:00
|
|
|
Position get_position (double, double) const;
|
|
|
|
void set_cursor (Position);
|
2016-06-05 17:16:20 -04:00
|
|
|
void route_gui_changed (PBD::PropertyChange const&);
|
2011-11-01 08:19:11 -04:00
|
|
|
bool suspending_editor_updates () const;
|
2012-01-09 13:03:49 -05:00
|
|
|
double playhead_frame_to_position (framepos_t) const;
|
2012-07-23 22:58:28 -04:00
|
|
|
framepos_t position_to_playhead_frame_to_position (double pos) const;
|
2012-01-09 13:03:49 -05:00
|
|
|
void set_overlays_dirty (int, int, int, int);
|
2009-06-10 21:05:01 -04:00
|
|
|
|
2010-12-03 17:26:29 -05:00
|
|
|
framepos_t _start; ///< start frame of the overview
|
|
|
|
framepos_t _end; ///< end frame of the overview
|
2009-11-25 08:44:57 -05:00
|
|
|
|
|
|
|
/** fraction of the session length by which the overview size should extend past the start and end markers */
|
|
|
|
double _overhang_fraction;
|
|
|
|
|
2009-06-15 18:45:05 -04:00
|
|
|
double _x_scale; ///< pixels per frame for the x axis of the pixmap
|
2010-06-15 13:37:44 -04:00
|
|
|
double _track_height;
|
2009-06-16 20:29:56 -04:00
|
|
|
double _last_playhead;
|
2009-06-14 21:21:30 -04:00
|
|
|
|
2009-06-15 21:03:24 -04:00
|
|
|
std::pair<double, double> _start_editor_x;
|
|
|
|
std::pair<double, double> _start_editor_y;
|
|
|
|
double _start_mouse_x;
|
|
|
|
double _start_mouse_y;
|
2010-06-17 20:05:44 -04:00
|
|
|
|
|
|
|
Position _start_position;
|
2009-06-15 21:03:24 -04:00
|
|
|
|
2009-06-14 21:21:30 -04:00
|
|
|
bool _move_dragging;
|
2009-06-14 09:30:21 -04:00
|
|
|
bool _moved;
|
2010-06-17 20:05:44 -04:00
|
|
|
std::pair<double, double> _view_rectangle_x;
|
|
|
|
std::pair<double, double> _view_rectangle_y;
|
2009-06-14 21:21:30 -04:00
|
|
|
|
2011-11-01 08:19:11 -04:00
|
|
|
std::pair<double, double> _pending_editor_x;
|
|
|
|
std::pair<double, double> _pending_editor_y;
|
|
|
|
bool _pending_editor_changed;
|
|
|
|
|
2009-06-14 21:21:30 -04:00
|
|
|
bool _zoom_dragging;
|
2010-06-17 20:05:44 -04:00
|
|
|
Position _zoom_position;
|
2009-12-19 15:26:31 -05:00
|
|
|
|
2011-01-16 14:33:16 -05:00
|
|
|
bool _old_follow_playhead;
|
2014-06-17 07:44:36 -04:00
|
|
|
cairo_surface_t* _image;
|
|
|
|
void render_background_image ();
|
|
|
|
bool _background_dirty;
|
2011-01-16 14:33:16 -05:00
|
|
|
|
2009-12-19 15:26:31 -05:00
|
|
|
PBD::ScopedConnectionList position_connection;
|
2012-11-14 00:01:28 -05:00
|
|
|
PBD::ScopedConnection route_ctrl_id_connection;
|
2009-12-19 15:26:31 -05:00
|
|
|
PBD::ScopedConnectionList region_property_connection;
|
2009-06-10 21:05:01 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|