From ad314252f4b578d268ed21d90969fc0a7102f4bb Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 16 Jan 2011 19:33:16 +0000 Subject: [PATCH] Disable follow playhead during editor summary drags. git-svn-id: svn://localhost/ardour2/branches/3.0@8518 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor_summary.cc | 9 ++++++++- gtk2_ardour/editor_summary.h | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index e279da94d3..65395274ef 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -50,7 +50,8 @@ EditorSummary::EditorSummary (Editor* e) _moved (false), _view_rectangle_x (0, 0), _view_rectangle_y (0, 0), - _zoom_dragging (false) + _zoom_dragging (false), + _old_follow_playhead (false) { Region::RegionPropertyChanged.connect (region_property_connection, invalidator (*this), boost::bind (&CairoWidget::set_dirty, this), gui_context()); _editor->playhead_cursor->PositionChanged.connect (position_connection, invalidator (*this), ui_bind (&EditorSummary::playhead_position_changed, this, _1), gui_context()); @@ -322,6 +323,8 @@ EditorSummary::on_button_press_event (GdkEventButton* ev) _zoom_position = get_position (ev->x, ev->y); _zoom_dragging = true; _editor->_dragging_playhead = true; + _old_follow_playhead = _editor->follow_playhead (); + _editor->set_follow_playhead (false); } else if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) { @@ -341,6 +344,8 @@ EditorSummary::on_button_press_event (GdkEventButton* ev) _move_dragging = true; _moved = false; _editor->_dragging_playhead = true; + _old_follow_playhead = _editor->follow_playhead (); + _editor->set_follow_playhead (false); } } @@ -523,6 +528,8 @@ EditorSummary::on_button_release_event (GdkEventButton*) _move_dragging = false; _zoom_dragging = false; _editor->_dragging_playhead = false; + _editor->set_follow_playhead (_old_follow_playhead); + return true; } diff --git a/gtk2_ardour/editor_summary.h b/gtk2_ardour/editor_summary.h index 823a0ca6a8..2b1e5be791 100644 --- a/gtk2_ardour/editor_summary.h +++ b/gtk2_ardour/editor_summary.h @@ -106,6 +106,8 @@ private: bool _zoom_dragging; Position _zoom_position; + bool _old_follow_playhead; + PBD::ScopedConnectionList position_connection; PBD::ScopedConnectionList region_property_connection; };