summaryrefslogtreecommitdiff
path: root/libs/ardour/ltc_slave.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2019-01-24 22:05:20 -0700
committerPaul Davis <paul@linuxaudiosystems.com>2019-01-25 09:23:08 -0700
commit1be3301342c74fdbb92febcbc85e8d60fb09de0e (patch)
tree4fbdc594951ed02e89c0b47e10ccaae75e9b69fd /libs/ardour/ltc_slave.cc
parentc01ab83e1f13f6d56a2e8ec13e9d26683dc9bb25 (diff)
new approach to handling Transport Masters when engine is restarted
Trust that ::reset() works for all transport masters, and call it when engine is stopped. This way the transport masters are ready to be called again as soon as the engine restarts.
Diffstat (limited to 'libs/ardour/ltc_slave.cc')
-rw-r--r--libs/ardour/ltc_slave.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/libs/ardour/ltc_slave.cc b/libs/ardour/ltc_slave.cc
index 9f8411103f..9fe2635446 100644
--- a/libs/ardour/ltc_slave.cc
+++ b/libs/ardour/ltc_slave.cc
@@ -104,7 +104,7 @@ LTC_TransportMaster::set_session (Session *s)
decoder = ltc_decoder_create((int) samples_per_ltc_frame, 128 /*queue size*/);
parse_timecode_offset();
- reset();
+ reset (true);
_session->config.ParameterChanged.connect_same_thread (config_connection, boost::bind (&LTC_TransportMaster::parameter_changed, this, _1));
}
@@ -189,10 +189,10 @@ LTC_TransportMaster::resync_latency()
}
void
-LTC_TransportMaster::reset (bool with_ts)
+LTC_TransportMaster::reset (bool with_position)
{
DEBUG_TRACE (DEBUG::LTC, "LTC reset()\n");
- if (with_ts) {
+ if (with_position) {
current.update (current.position, 0, current.speed);
_current_delta = 0;
}
@@ -381,7 +381,7 @@ LTC_TransportMaster::process_ltc(samplepos_t const now)
}
if (!ltc_is_stationary && detect_ltc_fps (stime.frame, (sample.ltc.dfbit)? true : false)) {
- reset();
+ reset(true);
fps_detected=true;
}
@@ -528,7 +528,7 @@ LTC_TransportMaster::pre_process (ARDOUR::pframes_t nframes, samplepos_t now, bo
} else if (skip != 0) {
/* this should never happen. it may if monotonic_cnt, now overflow on 64bit */
DEBUG_TRACE (DEBUG::LTC, string_compose("engine skipped %1 samples\n", skip));
- reset();
+ reset(true);
}
/* Now feed the incoming LTC signal into the decoder */
@@ -553,7 +553,7 @@ LTC_TransportMaster::pre_process (ARDOUR::pframes_t nframes, samplepos_t now, bo
if (abs (now - current.timestamp) > FLYWHEEL_TIMEOUT) {
DEBUG_TRACE (DEBUG::LTC, "flywheel timeout\n");
- reset();
+ reset(true);
/* don't change position from last known */
return;