2009-06-15 18:45:05 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2009-2012 Carl Hetherington <carl@carlh.net>
|
|
|
|
* Copyright (C) 2009-2017 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
* Copyright (C) 2012-2017 Robin Gareus <robin@gareus.org>
|
|
|
|
* Copyright (C) 2017-2019 Ben Loftis <ben@harrisonconsoles.com>
|
|
|
|
*
|
|
|
|
* 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.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2009-06-15 18:45:05 -04:00
|
|
|
|
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,
|
|
|
|
RIGHT,
|
|
|
|
BOTTOM,
|
|
|
|
INSIDE,
|
2017-07-14 14:00:41 -04:00
|
|
|
TO_LEFT_OR_RIGHT
|
2010-06-17 20:05:44 -04:00
|
|
|
};
|
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 *);
|
2017-07-14 14:00:41 -04:00
|
|
|
bool on_key_press_event (GdkEventKey*);
|
|
|
|
bool on_key_release_event (GdkEventKey*);
|
|
|
|
bool on_enter_notify_event (GdkEventCrossing*);
|
|
|
|
bool on_leave_notify_event (GdkEventCrossing*);
|
2009-06-10 21:05:01 -04:00
|
|
|
|
2017-08-27 00:32:02 -04:00
|
|
|
void reset_to_extents ();
|
|
|
|
|
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;
|
2017-07-14 14:00:41 -04:00
|
|
|
void get_editor (std::pair<double, double>* x, std::pair<double, double>* y = NULL) const;
|
|
|
|
void set_editor (double);
|
|
|
|
void set_editor (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>);
|
2017-09-18 12:39:17 -04:00
|
|
|
void playhead_position_changed (samplepos_t);
|
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;
|
2017-09-18 12:39:17 -04:00
|
|
|
double playhead_sample_to_position (samplepos_t) const;
|
|
|
|
samplepos_t position_to_playhead_sample_to_position (double pos) const;
|
2017-08-26 22:56:42 -04:00
|
|
|
void set_overlays_dirty_rect (int, int, int, int);
|
2009-06-10 21:05:01 -04:00
|
|
|
|
2017-07-19 09:12:25 -04:00
|
|
|
void summary_zoom_step ( int steps );
|
|
|
|
|
2017-09-18 12:39:17 -04:00
|
|
|
samplepos_t _start; ///< start sample of the overview
|
|
|
|
samplepos_t _end; ///< end sample of the overview
|
2009-11-25 08:44:57 -05:00
|
|
|
|
2017-09-18 12:39:17 -04:00
|
|
|
samplepos_t _leftmost; ///< the earliest sample we ever viewed
|
|
|
|
samplepos_t _rightmost; ///< the latest sample we ever viewed
|
2017-07-19 14:58:56 -04:00
|
|
|
|
2017-09-18 12:39:17 -04:00
|
|
|
double _x_scale; ///< pixels per sample 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;
|
|
|
|
double _start_mouse_x;
|
2017-07-18 11:37:35 -04:00
|
|
|
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;
|
2017-07-20 15:14:35 -04:00
|
|
|
|
2019-02-12 12:30:31 -05:00
|
|
|
void set_colors ();
|
|
|
|
uint32_t _phead_color;
|
|
|
|
|
2017-07-20 15:14:35 -04:00
|
|
|
//used for zooming
|
|
|
|
int _last_mx;
|
|
|
|
int _last_my;
|
|
|
|
int _last_dx;
|
|
|
|
int _last_dy;
|
|
|
|
int _last_y_delta;
|
|
|
|
|
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;
|
|
|
|
|
2017-07-18 11:37:35 -04:00
|
|
|
bool _zoom_trim_dragging;
|
|
|
|
Position _zoom_trim_position;
|
|
|
|
|
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
|