summaryrefslogtreecommitdiff
path: root/gtk2_ardour/editor_drag.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-08-02 01:59:34 +0000
committerCarl Hetherington <carl@carlh.net>2010-08-02 01:59:34 +0000
commit8b0354f91003582c4eafc4f2e1ef7ab2daba22e7 (patch)
tree344765bdf6c26782cf6c76f1a8aed23a82dda350 /gtk2_ardour/editor_drag.cc
parent5d8933893c1bb889eb4ff95971b5a579bd7ea5da (diff)
Suspend transport timecode transmission during playhead drag. Should fix #3324.
git-svn-id: svn://localhost/ardour2/branches/3.0@7528 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_drag.cc')
-rw-r--r--gtk2_ardour/editor_drag.cc39
1 files changed, 26 insertions, 13 deletions
diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc
index 27ca9b6c78..48ddeb55d2 100644
--- a/gtk2_ardour/editor_drag.cc
+++ b/gtk2_ardour/editor_drag.cc
@@ -2110,18 +2110,24 @@ CursorDrag::start_grab (GdkEvent* event, Gdk::Cursor* c)
if (_cursor == _editor->playhead_cursor) {
_editor->_dragging_playhead = true;
- if (_editor->session()) {
+ Session* s = _editor->session ();
+
+ if (s) {
if (_was_rolling && _stop) {
- _editor->session()->request_stop ();
+ s->request_stop ();
}
- if (_editor->session()->is_auditioning()) {
- _editor->session()->cancel_audition ();
+ if (s->is_auditioning()) {
+ s->cancel_audition ();
}
- nframes64_t const f = _editor->playhead_cursor->current_frame;
- _editor->session()->send_mmc_locate (f);
- _editor->session()->send_full_time_code (f);
+ s->request_suspend_timecode_transmission ();
+
+ if (s->timecode_transmission_suspended ()) {
+ nframes64_t const f = _editor->playhead_cursor->current_frame;
+ s->send_mmc_locate (f);
+ s->send_full_time_code (f);
+ }
}
}
@@ -2143,10 +2149,11 @@ CursorDrag::motion (GdkEvent* event, bool)
_editor->show_verbose_time_cursor (_cursor->current_frame, 10);
- if (_editor->session() && _item == &_editor->playhead_cursor->canvas_item) {
+ Session* s = _editor->session ();
+ if (s && _item == &_editor->playhead_cursor->canvas_item && s->timecode_transmission_suspended ()) {
nframes64_t const f = _editor->playhead_cursor->current_frame;
- _editor->session()->send_mmc_locate (f);
- _editor->session()->send_full_time_code (f);
+ s->send_mmc_locate (f);
+ s->send_full_time_code (f);
}
@@ -2168,9 +2175,11 @@ CursorDrag::finished (GdkEvent* event, bool movement_occurred)
motion (event, false);
if (_item == &_editor->playhead_cursor->canvas_item) {
- if (_editor->session()) {
- _editor->session()->request_locate (_editor->playhead_cursor->current_frame, _was_rolling);
+ Session* s = _editor->session ();
+ if (s) {
+ s->request_locate (_editor->playhead_cursor->current_frame, _was_rolling);
_editor->_pending_locate_request = true;
+ s->request_resume_timecode_transmission ();
}
}
}
@@ -2178,7 +2187,11 @@ CursorDrag::finished (GdkEvent* event, bool movement_occurred)
void
CursorDrag::aborted ()
{
- _editor->_dragging_playhead = false;
+ if (_editor->_dragging_playhead) {
+ _editor->session()->request_resume_timecode_transmission ();
+ _editor->_dragging_playhead = false;
+ }
+
_cursor->set_position (adjusted_frame (grab_frame (), 0, false));
}