Send full MTC messages every 1/4 of a second when quarter-frame messages are suspended (due to out-of-range transport speed)
git-svn-id: svn://localhost/ardour2/branches/3.0@8429 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
6933d6f945
commit
4273093d40
@ -960,6 +960,10 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
|
||||
std::string _name;
|
||||
bool _is_new;
|
||||
bool _send_qf_mtc;
|
||||
/** Number of process frames since the last MTC output (when sending MTC); used to
|
||||
* know when to send full MTC messages every so often.
|
||||
*/
|
||||
pframes_t _pframes_since_last_mtc;
|
||||
bool session_midi_feedback;
|
||||
bool play_loop;
|
||||
bool loop_changing;
|
||||
|
@ -400,6 +400,7 @@ Session::send_full_time_code (framepos_t const t)
|
||||
return -1;
|
||||
}
|
||||
|
||||
_pframes_since_last_mtc = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -270,6 +270,7 @@ Session::process_with_events (pframes_t nframes)
|
||||
bool const was_sending_qf_mtc = _send_qf_mtc;
|
||||
double const tolerance = Config->get_mtc_qf_speed_tolerance() / 100.0;
|
||||
|
||||
if (_transport_speed != 0) {
|
||||
_send_qf_mtc = (
|
||||
Config->get_send_mtc () &&
|
||||
_transport_speed >= (1 - tolerance) &&
|
||||
@ -281,6 +282,17 @@ Session::process_with_events (pframes_t nframes)
|
||||
_send_timecode_update = true;
|
||||
}
|
||||
|
||||
if (Config->get_send_mtc() && !_send_qf_mtc && _pframes_since_last_mtc > (frame_rate () / 4)) {
|
||||
/* we're sending MTC, but we're not sending QF MTC at the moment, and it's been
|
||||
a quarter of a second since we sent anything at all, so send a full MTC update
|
||||
this cycle.
|
||||
*/
|
||||
_send_timecode_update = true;
|
||||
}
|
||||
|
||||
_pframes_since_last_mtc += nframes;
|
||||
}
|
||||
|
||||
/* Events caused a transport change (or we re-started sending
|
||||
* MTC), so send an MTC Full Frame (Timecode) message. This
|
||||
* is sent whether rolling or not, to give slaves an idea of
|
||||
|
@ -207,6 +207,7 @@ Session::first_stage_init (string fullpath, string snapshot_name)
|
||||
_was_seamless = Config->get_seamless_loop ();
|
||||
_slave = 0;
|
||||
_send_qf_mtc = false;
|
||||
_pframes_since_last_mtc = 0;
|
||||
g_atomic_int_set (&_playback_load, 100);
|
||||
g_atomic_int_set (&_capture_load, 100);
|
||||
_play_range = false;
|
||||
|
Loading…
Reference in New Issue
Block a user