From cba911619631b935cf3cd316a80892fa6ea1c381 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 1 Dec 2006 17:32:41 +0000 Subject: don't update clocks while dragging playhead git-svn-id: svn://localhost/ardour2/trunk@1183 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour_ui.cc | 4 +++- gtk2_ardour/editor.cc | 1 + gtk2_ardour/editor.h | 3 +++ gtk2_ardour/editor_mixer.cc | 8 +++++++- gtk2_ardour/editor_mouse.cc | 8 ++++++-- gtk2_ardour/public_editor.h | 1 + svn_revision.h | 2 +- 7 files changed, 22 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 952e8dd02d..a79546f58f 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -1310,7 +1310,9 @@ ARDOUR_UI::start_engine () void ARDOUR_UI::update_clocks () { - Clock (session->audible_frame()); /* EMIT_SIGNAL */ + if (!editor || !editor->dragging_playhead()) { + Clock (session->audible_frame()); /* EMIT_SIGNAL */ + } } void diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 45cb912934..fd135f1538 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -308,6 +308,7 @@ Editor::Editor (AudioEngine& eng) playhead_cursor = 0; button_release_can_deselect = true; canvas_idle_queued = false; + _dragging_playhead = false; location_marker_color = color_map[cLocationMarker]; location_range_color = color_map[cLocationRange]; diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index eb2c4a9b67..85f866e923 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -286,6 +286,7 @@ class Editor : public PublicEditor void set_follow_playhead (bool yn); void toggle_follow_playhead (); bool follow_playhead() const { return _follow_playhead; } + bool dragging_playhead () const { return _dragging_playhead; } void toggle_waveform_visibility (); void toggle_waveforms_while_recording (); @@ -1041,6 +1042,8 @@ class Editor : public PublicEditor void region_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*); void region_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*); + bool _dragging_playhead; + void cursor_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*); void cursor_drag_finished_callback (ArdourCanvas::Item*, GdkEvent*); void marker_drag_motion_callback (ArdourCanvas::Item*, GdkEvent*); diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc index 52f48b8174..bfbb5104b2 100644 --- a/gtk2_ardour/editor_mixer.cc +++ b/gtk2_ardour/editor_mixer.cc @@ -164,11 +164,16 @@ Editor::update_current_screen () frame = session->audible_frame(); + if (_dragging_playhead) { + goto almost_done; + } + /* only update if the playhead is on screen or we are following it */ if (_follow_playhead) { - playhead_cursor->canvas_item.show(); + playhead_cursor->canvas_item.show(); + if (frame != last_update_frame) { if (frame < leftmost_frame || frame > leftmost_frame + current_page_frames()) { @@ -198,6 +203,7 @@ Editor::update_current_screen () } } + almost_done: last_update_frame = frame; if (current_mixer_strip) { diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index da058095ea..11536d60f4 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -1942,8 +1942,10 @@ Editor::start_cursor_grab (ArdourCanvas::Item* item, GdkEvent* event) Cursor* cursor = (Cursor *) drag_info.data; - if (session && cursor == playhead_cursor) { - if (drag_info.was_rolling) { + if (cursor == playhead_cursor) { + _dragging_playhead = true; + + if (session && drag_info.was_rolling) { session->request_stop (); } } @@ -1994,6 +1996,8 @@ Editor::cursor_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event if (drag_info.first_move) return; cursor_drag_motion_callback (item, event); + + _dragging_playhead = false; if (item == &playhead_cursor->canvas_item) { if (session) { diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 3b50765d42..390cb20ca8 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -117,6 +117,7 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulThingWithGoingAway virtual void set_follow_playhead (bool yn) = 0; virtual void toggle_follow_playhead () = 0; virtual bool follow_playhead() const = 0; + virtual bool dragging_playhead() const = 0; virtual void ensure_float (Gtk::Window&) = 0; virtual void show_window () = 0; virtual TrackViewList* get_valid_views (TimeAxisView*, ARDOUR::RouteGroup* grp = 0) = 0; diff --git a/svn_revision.h b/svn_revision.h index bed6e4fdd3..89d7c9563a 100644 --- a/svn_revision.h +++ b/svn_revision.h @@ -1,4 +1,4 @@ #ifndef __ardour_svn_revision_h__ #define __ardour_svn_revision_h__ -static const char* ardour_svn_revision = "1173"; +static const char* ardour_svn_revision = "1180"; #endif -- cgit v1.2.3