summaryrefslogtreecommitdiff
path: root/libs/ardour/ltc_slave.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2012-10-29 17:29:34 +0000
committerRobin Gareus <robin@gareus.org>2012-10-29 17:29:34 +0000
commit52532839110d4bbd2e4dc3e0eb8967d0f278a611 (patch)
treeb2e71ba9e3e3a795e8df73cb3fe5d323a7d2809c /libs/ardour/ltc_slave.cc
parentb0fb2a032b09ce17d9ebc44fca71d301a47b04af (diff)
LTC: break out xrun and latency callbacks.
prepare to call get_connected_latency_range() only if needed. git-svn-id: svn://localhost/ardour2/branches/3.0@13366 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ltc_slave.cc')
-rw-r--r--libs/ardour/ltc_slave.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/libs/ardour/ltc_slave.cc b/libs/ardour/ltc_slave.cc
index 4f6f77ce1f..f176c206a3 100644
--- a/libs/ardour/ltc_slave.cc
+++ b/libs/ardour/ltc_slave.cc
@@ -61,7 +61,8 @@ LTC_Slave::LTC_Slave (Session& s)
decoder = ltc_decoder_create((int) frames_per_ltc_frame, 128 /*queue size*/);
reset();
- session.Xrun.connect_same_thread (port_connections, boost::bind (&LTC_Slave::resync_latency, this));
+ resync_latency();
+ session.Xrun.connect_same_thread (port_connections, boost::bind (&LTC_Slave::resync_xrun, this));
session.engine().GraphReordered.connect_same_thread (port_connections, boost::bind (&LTC_Slave::resync_latency, this));
}
@@ -95,9 +96,16 @@ LTC_Slave::ok() const
}
void
+LTC_Slave::resync_xrun()
+{
+ DEBUG_TRACE (DEBUG::LTC, "LTC resync_xrun()\n");
+ engine_dll_initstate = 0;
+}
+
+void
LTC_Slave::resync_latency()
{
- DEBUG_TRACE (DEBUG::LTC, "LTC resync()\n");
+ DEBUG_TRACE (DEBUG::LTC, "LTC resync_latency()\n");
engine_dll_initstate = 0;
if (session.ltc_output_io()) { /* check if Port exits */
@@ -115,7 +123,6 @@ LTC_Slave::reset()
transport_direction = 0;
ltc_speed = 0;
engine_dll_initstate = 0;
- resync_latency();
}
void
@@ -378,6 +385,9 @@ LTC_Slave::speed_and_position (double& speed, framepos_t& pos)
* ..but first fix jack2 issue with re-computing latency
* in the correct order. Until then, querying it in the
* process-callback is the only way to get the current value
+ *
+ * update: fix for this issue is known -- common/JackEngine.cpp
+ * but not yet applied to jack2 git.
*/
ltcport->get_connected_latency_range(ltc_slave_latency, false);
#endif