2009-12-17 18:36:52 -05:00
|
|
|
|
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__
|
|
|
|
|
2009-06-20 09:41:55 -04:00
|
|
|
#include "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.
|
|
|
|
*/
|
2010-07-19 17:47:07 -04:00
|
|
|
class EditorSummary : public CairoWidget, public EditorComponent, public ARDOUR::SessionHandlePtr
|
2009-06-10 21:05:01 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
EditorSummary (Editor *);
|
|
|
|
|
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 ();
|
2009-06-10 21:05:01 -04:00
|
|
|
|
|
|
|
private:
|
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
|
|
|
|
};
|
|
|
|
|
2009-06-10 21:05:01 -04:00
|
|
|
bool on_expose_event (GdkEventExpose *);
|
|
|
|
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 *);
|
2009-06-10 21:05:01 -04:00
|
|
|
|
2009-06-20 09:41:55 -04:00
|
|
|
void centre_on_click (GdkEventButton *);
|
2009-06-10 21:05:01 -04:00
|
|
|
void render (cairo_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;
|
2010-06-15 13:37:44 -04:00
|
|
|
void set_editor (std::pair<double, double> const &, double);
|
2010-06-17 20:05:44 -04:00
|
|
|
void set_editor (std::pair<double, double> const &, std::pair<double, double> const &);
|
|
|
|
void set_editor_x (std::pair<double, double> const &);
|
|
|
|
void set_editor_y (double);
|
|
|
|
void set_editor_y (std::pair<double, double> const &);
|
2009-06-16 20:29:56 -04:00
|
|
|
void playhead_position_changed (nframes64_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);
|
2009-06-10 21:05:01 -04:00
|
|
|
|
2009-11-25 08:44:57 -05:00
|
|
|
nframes_t _start; ///< start frame of the overview
|
|
|
|
nframes_t _end; ///< end frame of the overview
|
|
|
|
|
|
|
|
/** 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
|
|
|
|
|
|
|
bool _zoom_dragging;
|
2010-06-17 20:05:44 -04:00
|
|
|
Position _zoom_position;
|
2009-12-19 15:26:31 -05:00
|
|
|
|
|
|
|
PBD::ScopedConnectionList position_connection;
|
|
|
|
PBD::ScopedConnectionList region_property_connection;
|
2009-06-10 21:05:01 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|