*/
virtual samplecnt_t resolution() const = 0;
+ /**
+ * @return - the expected update interval for the data source used by
+ * this transport master. Even if the data is effectively continuous,
+ * this number indicates how long it is between changes to the known
+ * position of the master.
+ */
+ virtual samplecnt_t update_interval() const = 0;
+
/**
* @return - when returning true, ARDOUR will wait for seekahead_distance() before transport
* starts rolling
bool ok() const;
void handle_locate (const MIDI::byte*);
+ samplecnt_t update_interval () const;
samplecnt_t resolution () const;
bool requires_seekahead () const { return false; }
samplecnt_t seekahead_distance() const;
bool locked() const;
bool ok() const;
+ samplecnt_t update_interval () const;
samplecnt_t resolution () const;
bool requires_seekahead () const { return false; }
samplecnt_t seekahead_distance () const { return 0; }
bool ok() const;
bool starting() const;
+ samplecnt_t update_interval () const;
samplecnt_t resolution () const;
bool requires_seekahead () const { return false; }
void init ();
bool starting() const { return _starting; }
bool locked() const;
bool ok() const;
+ samplecnt_t update_interval () const;
samplecnt_t resolution () const { return 1; }
bool requires_seekahead () const { return false; }
bool sample_clock_synced() const { return true; }
}
if ((speed > 0) && (start_sample != playback_sample)) {
- cerr << owner()->name() << " playback not aligned, jump ahead " << (start_sample - playback_sample) << endl;
+ stringstream str;
+ str << owner()->name() << " playback @ " << start_sample << " not aligned with " << playback_sample << " jump ahead " << (start_sample - playback_sample) << endl;
+ cerr << str.str();
if (can_internal_playback_seek (start_sample - playback_sample)) {
internal_playback_seek (start_sample - playback_sample);
return true;
}
+
+samplecnt_t
+Engine_TransportMaster::update_interval () const
+{
+ return AudioEngine::instance()->samples_per_cycle();
+}
+
}
}
+ARDOUR::samplecnt_t
+LTC_TransportMaster::update_interval() const
+{
+ if (timecode.rate) {
+ return AudioEngine::instance()->sample_rate() / timecode.rate;
+ }
+
+ return AudioEngine::instance()->sample_rate(); /* useless but what other answer is there? */
+}
+
ARDOUR::samplecnt_t
LTC_TransportMaster::resolution () const
{
samplepos_t cur_timestamp = sample.off_end + 1;
double ltc_speed = current.speed;
- DEBUG_TRACE (DEBUG::LTC, string_compose ("LTC S: %1 LS: %2 N: %3 L: %4\n", ltc_sample, current.position, cur_timestamp, current.timestamp));
+ DEBUG_TRACE (DEBUG::LTC, string_compose ("LTC S: %1 LS: %2 N: %3 L: %4 span %5..%6\n", ltc_sample, current.position, cur_timestamp, current.timestamp, sample.off_start, sample.off_end));
if (cur_timestamp <= current.timestamp || current.timestamp == 0) {
DEBUG_TRACE (DEBUG::LTC, string_compose ("LTC speed: UNCHANGED: %1\n", current.speed));
DEBUG_TRACE (DEBUG::LTC, string_compose ("LTC speed: %1\n", ltc_speed));
}
-
+ DEBUG_TRACE (DEBUG::LTC, string_compose ("update current to %1 %2 %3\n", ltc_sample, cur_timestamp, ltc_speed));
current.update (ltc_sample, cur_timestamp, ltc_speed);
} /* end foreach decoded LTC sample */
return false;
}
+ARDOUR::samplecnt_t
+MIDIClock_TransportMaster::update_interval() const
+{
+ if (one_ppqn_in_samples) {
+ return resolution ();
+ }
+
+ return AudioEngine::instance()->sample_rate() / 120 / 4; /* pure guesswork */
+}
+
ARDOUR::samplecnt_t
MIDIClock_TransportMaster::resolution() const
{
}
}
+ARDOUR::samplecnt_t
+MTC_TransportMaster::update_interval() const
+{
+ if (timecode.rate) {
+ return AudioEngine::instance()->sample_rate() / timecode.rate;
+ }
+
+ return AudioEngine::instance()->sample_rate(); /* useless but what other answer is there? */
+}
+
ARDOUR::samplecnt_t
MTC_TransportMaster::resolution () const
{
return false;
}
- if (last.timestamp && now > last.timestamp && now - last.timestamp > labs (seekahead_distance())) {
+ if (last.timestamp && now > last.timestamp && now - last.timestamp > (2.0 * update_interval())) {
/* no timecode for two cycles - conclude that it's stopped */
if (!Config->get_transport_masters_just_roll_when_sync_lost()) {
when = last.timestamp;
_current_delta = 0;
// queue_reset (false);
- DEBUG_TRACE (DEBUG::Slave, string_compose ("%1 not seen for 2 samples - reset pending, pos = %2\n", name(), pos));
+ DEBUG_TRACE (DEBUG::Slave, string_compose ("%1 not seen since %2 vs %3 (%4) with seekahead = %5 reset pending, pos = %6\n", name(), last.timestamp, now, (now - last.timestamp), update_interval(), pos));
return false;
}
}