22 #include "canvas/debug.h"
49 _overhang_fraction (0.1),
53 _move_dragging (false),
55 _view_rectangle_x (0, 0),
56 _view_rectangle_y (0, 0),
57 _zoom_dragging (false),
58 _old_follow_playhead (false),
60 _background_dirty (true)
62 add_events (Gdk::POINTER_MOTION_MASK|Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK);
63 set_flags (get_flags() | Gtk::CAN_FOCUS);
70 cairo_surface_destroy (
_image);
77 if (p ==
"color-regions-using-track-color") {
99 SessionHandlePtr::set_session (s);
121 cairo_surface_destroy (
_image);
122 _image = cairo_image_surface_create (CAIRO_FORMAT_RGB24, get_width (), get_height ());
124 cairo_t* cr = cairo_create (
_image);
128 cairo_set_source_rgb (cr, 0, 0, 0);
129 cairo_rectangle (cr, 0, 0, get_width(), get_height());
136 _start = theoretical_start > 0 ? theoretical_start : 0;
142 if (!(*i)->hidden()) {
165 if ((*i)->hidden()) {
171 cairo_set_source_rgb (cr, 0.2, 0.2, 0.2);
194 cairo_set_line_width (cr, 1);
195 cairo_set_source_rgb (cr, 1, 1, 0);
198 cairo_move_to (cr, p, 0);
199 cairo_line_to (cr, p, get_height());
202 cairo_move_to (cr, q, 0);
203 cairo_line_to (cr, q, get_height());
225 cairo_push_group (cr);
229 cairo_rectangle (cr, 0, 0, get_width(), get_height());
230 cairo_set_source_surface (cr,
_image, 0, 0);
245 cairo_set_source_rgba (cr, 1, 1, 1, 0.1);
246 cairo_fill_preserve (cr);
247 cairo_set_line_width (cr, 1);
248 cairo_set_source_rgba (cr, 1, 1, 1, 0.4);
253 cairo_set_line_width (cr, 1);
255 cairo_set_source_rgba (cr, 1, 0, 0, 1);
258 cairo_move_to (cr, ph, 0);
259 cairo_line_to (cr, ph, get_height());
261 cairo_pop_group_to_source (cr);
281 cairo_move_to (cr, 0, y);
287 cairo_line_to (cr, 0, y);
313 queue_draw_area (x, y, w, h);
332 pair<double, double> xr;
333 pair<double, double> yr;
336 double const w = xr.second - xr.first;
337 double ex = ev->x - w / 2;
340 }
else if ((ex + w) > get_width()) {
341 ex = get_width() - w;
344 double const h = yr.second - yr.first;
345 double ey = ev->y - h / 2;
348 }
else if ((ey + h) > get_height()) {
349 ey = get_height() - h;
359 Keyboard::magic_widget_grab_focus ();
369 Keyboard::magic_widget_drop_focus ();
377 GtkAccelKey set_playhead_accel;
378 if (gtk_accel_map_lookup_entry (
"<Actions>/Editor/set-playhead", &set_playhead_accel)) {
379 if (key->keyval == set_playhead_accel.accel_key && (
int) key->state == set_playhead_accel.accel_mods) {
395 GtkAccelKey set_playhead_accel;
396 if (gtk_accel_map_lookup_entry (
"<Actions>/Editor/set-playhead", &set_playhead_accel)) {
397 if (key->keyval == set_playhead_accel.accel_key && (
int) key->state == set_playhead_accel.accel_mods) {
412 if (ev->button == 1) {
414 pair<double, double> xr;
415 pair<double, double> yr;
440 }
else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
447 }
else if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
464 ArdourCanvas::checkpoint (
"sum",
"------------------ summary move drag starts.\n");
516 x_edge_size = min (x_edge_size, 8);
517 x_edge_size = max (x_edge_size, 1);
520 y_edge_size = min (y_edge_size, 8);
521 y_edge_size = max (y_edge_size, 1);
526 bool const near_bottom = (std::abs (y -
_view_rectangle_y.second) < y_edge_size);
530 if (near_left && near_top) {
532 }
else if (near_left && near_bottom) {
534 }
else if (near_right && near_top) {
536 }
else if (near_right && near_bottom) {
538 }
else if (near_left && within_y) {
540 }
else if (near_right && within_y) {
542 }
else if (near_top && within_x) {
544 }
else if (near_bottom && within_x) {
546 }
else if (within_x && within_y) {
548 }
else if (within_x) {
550 }
else if (within_y) {
595 get_window()->set_cursor ();
689 pair<double, double> xr;
690 pair<double, double> yr;
695 switch (ev->direction) {
697 if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) {
699 }
else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) {
701 }
else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomVerticalModifier)) {
710 case GDK_SCROLL_DOWN:
711 if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollHorizontalModifier)) {
713 }
else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomHorizontalModifier)) {
715 }
else if (Keyboard::modifier_state_equals (ev->state, Keyboard::ScrollZoomVerticalModifier)) {
724 case GDK_SCROLL_LEFT:
725 if (Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier)) {
727 }
else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) {
733 case GDK_SCROLL_RIGHT:
734 if (Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier)) {
736 }
else if (Keyboard::modifier_state_contains (ev->state, Keyboard::TertiaryModifier)) {
848 x.second = x.first + 1;
882 if (y2 > full_editor_height) {
883 y1 -= y2 - full_editor_height;
922 pair<double, double> yc = y;
924 double total_height = 0;
926 double partial_height = 0;
928 double scale_height = 0;
934 if ((*i)->hidden()) {
938 double const h = (*i)->effective_height ();
962 double const scale = (ch - partial_height) / scale_height;
970 if ((*i)->hidden()) {
993 int a = max(2, min (o, n));
1005 if ((*i)->hidden()) {
1009 double const h = (*i)->effective_height ();
1028 if ((*i)->hidden()) {
1032 double const h = (*i)->effective_height ();
1048 for (list<RouteTimeAxisView*>::const_iterator i = r.begin(); i != r.end(); ++i) {
bool transport_rolling() const
Gdk::Cursor * resize_left
bool follow_playhead() const
void reset_y_origin(double)
void set_cursor(Position)
Gdk::Cursor * resize_bottom
VisualChange pending_visual_change
void set_follow_playhead(bool yn, bool catch_up=true)
std::pair< double, double > _start_editor_y
double summary_y_to_editor(double) const
std::pair< double, double > _pending_editor_y
double _overhang_fraction
bool on_scroll_event(GdkEventScroll *)
static PBD::Signal1< void, framepos_t > EndTimeChanged
shared_ptr< T > dynamic_pointer_cast(shared_ptr< U > const &r)
void centre_on_click(GdkEventButton *)
Gtk::Adjustment vertical_adjustment
void render_region(RegionView *, cairo_t *, double) const
double playhead_frame_to_position(framepos_t) const
ArdourCanvas::Container * get_trackview_group() const
void temporal_zoom_step(bool coarser)
PBD::ScopedConnectionList position_connection
void request_locate(framepos_t frame, bool with_roll=false)
EditorCursor * playhead_cursor
void render(cairo_t *, cairo_rectangle_t *)
#define ENSURE_GUI_THREAD(obj, method,...)
bool _old_follow_playhead
bool on_enter_notify_event(GdkEventCrossing *)
double editor_y_to_summary(double) const
PBD::Signal1< void, framepos_t > PositionChanged
bool _pending_editor_changed
void set_editor_y(double)
double _full_canvas_height
full height of the canvas
bool on_key_press_event(GdkEventKey *)
void parameter_changed(std::string)
static PBD::Signal1< void, framepos_t > StartTimeChanged
void set_editor(double, double)
LIBGTKMM2EXT_API uint64_t Keyboard
framepos_t current_frame() const
framepos_t _end
end frame of the overview
void foreach_regionview(sigc::slot< void, RegionView * > slot)
void on_size_request(Gtk::Requisition *)
void routes_added(std::list< RouteTimeAxisView * > const &)
double visible_canvas_height() const
void render_background_image()
boost::shared_ptr< ARDOUR::Region > region() const
Gdk::Cursor * resize_top_left
void reset_zoom(framecnt_t)
void playhead_position_changed(framepos_t)
void set_background_dirty()
PBD::ScopedConnection route_ctrl_id_connection
std::pair< double, double > _pending_editor_x
double _x_scale
pixels per frame for the x axis of the pixmap
framecnt_t get_current_zoom() const
Gdk::Cursor * expand_up_down
void route_gui_changed(std::string)
uint32_t get_fill_color() const
PBD::ScopedConnectionList _session_connections
Gdk::Cursor * resize_top_right
PBD::Signal0< void > PlaylistChanged
bool on_leave_notify_event(GdkEventCrossing *)
framepos_t position() const
framepos_t position_to_playhead_frame_to_position(double pos) const
double sample_to_pixel(framepos_t sample) const
std::pair< double, double > _start_editor_x
Gdk::Cursor * resize_bottom_right
framecnt_t current_page_samples() const
framepos_t current_end_frame() const
std::pair< double, double > _view_rectangle_x
framepos_t leftmost_sample() const
framepos_t current_start_frame() const
static UIConfiguration * config()
bool on_button_press_event(GdkEventButton *)
bool on_motion_notify_event(GdkEventMotion *)
bool on_button_release_event(GdkEventButton *)
Gdk::Cursor * resize_right
void set_session(ARDOUR::Session *)
Gdk::Cursor * resize_bottom_left
TrackViewList track_views
sigc::signal< void, std::string > ParameterChanged
std::pair< double, double > _view_rectangle_y
Position get_position(double, double) const
void reset_x_origin(framepos_t)
framecnt_t length() const
T * get_pointer(shared_ptr< T > const &p)
static uint32_t preset_height(Height)
void get_editor(std::pair< double, double > *, std::pair< double, double > *) const
sigc::signal< void > RegionsChanged
void on_size_allocate(Gtk::Allocation &alloc)
framepos_t _start
start frame of the overview
void set_overlays_dirty()
PBD::ScopedConnectionList region_property_connection
ARDOUR::Session * _session
bool suspending_editor_updates() const
Gdk::Cursor * expand_left_right
bool on_key_release_event(GdkEventKey *)
void set_editor_x(double)