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.
|
|
|
|
*/
|
2009-07-03 14:37:15 -04:00
|
|
|
class EditorSummary : public CairoWidget, public EditorComponent
|
2009-06-10 21:05:01 -04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
EditorSummary (Editor *);
|
|
|
|
|
2009-07-03 14:37:15 -04:00
|
|
|
void connect_to_session (ARDOUR::Session *);
|
2009-06-16 20:29:56 -04:00
|
|
|
void set_overlays_dirty ();
|
2009-06-10 21:05:01 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
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 *);
|
|
|
|
void render_region (RegionView*, cairo_t*, nframes_t, double) const;
|
2009-06-15 21:03:24 -04:00
|
|
|
void get_editor (std::pair<double, double> *, std::pair<double, double> *) const;
|
|
|
|
void set_editor (std::pair<double, double> const &, std::pair<double, double> const &);
|
2009-06-16 20:29:56 -04:00
|
|
|
void playhead_position_changed (nframes64_t);
|
2009-06-10 21:05:01 -04:00
|
|
|
|
2009-06-15 18:45:05 -04:00
|
|
|
double _x_scale; ///< pixels per frame for the x axis of the pixmap
|
|
|
|
double _y_scale;
|
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;
|
|
|
|
|
2009-06-14 21:21:30 -04:00
|
|
|
bool _move_dragging;
|
2009-06-13 13:52:51 -04:00
|
|
|
double _x_offset;
|
|
|
|
double _y_offset;
|
2009-06-14 09:30:21 -04:00
|
|
|
bool _moved;
|
2009-06-14 21:21:30 -04:00
|
|
|
|
|
|
|
bool _zoom_dragging;
|
2009-06-16 20:16:52 -04:00
|
|
|
bool _zoom_left;
|
2009-06-10 21:05:01 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|