summaryrefslogtreecommitdiff
path: root/libs/ardour/session_transport.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 /libs/ardour/session_transport.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 'libs/ardour/session_transport.cc')
-rw-r--r--libs/ardour/session_transport.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/libs/ardour/session_transport.cc b/libs/ardour/session_transport.cc
index 2897c5cd8f..b722bc04a7 100644
--- a/libs/ardour/session_transport.cc
+++ b/libs/ardour/session_transport.cc
@@ -1568,3 +1568,27 @@ Session::send_mmc_locate (nframes64_t t)
timecode_time_subframes (t, time);
MIDI::Manager::instance()->mmc()->send (MIDI::MachineControlCommand (time));
}
+
+/** Ask the transport to not send timecode until further notice. The suspension
+ * will come into effect some finite time after this call, and timecode_transmission_suspended()
+ * should be checked by the caller to find out when.
+ */
+void
+Session::request_suspend_timecode_transmission ()
+{
+ SessionEvent* ev = new SessionEvent (SessionEvent::SetTimecodeTransmission, SessionEvent::Add, SessionEvent::Immediate, 0, 0, false);
+ queue_event (ev);
+}
+
+void
+Session::request_resume_timecode_transmission ()
+{
+ SessionEvent* ev = new SessionEvent (SessionEvent::SetTimecodeTransmission, SessionEvent::Add, SessionEvent::Immediate, 0, 0, true);
+ queue_event (ev);
+}
+
+bool
+Session::timecode_transmission_suspended () const
+{
+ return g_atomic_int_get (&_suspend_timecode_transmission) == 1;
+}