13
0

MTC-slave: print error if framerate mismatch

git-svn-id: svn://localhost/ardour2/branches/3.0@13231 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Robin Gareus 2012-10-10 20:37:56 +00:00
parent 2b1cc9656e
commit 915797fd23
2 changed files with 30 additions and 4 deletions

View File

@ -260,6 +260,10 @@ class MTC_Slave : public Slave {
int busy_guard1;
int busy_guard2;
TimecodeFormat mtc_timecode;
TimecodeFormat a3e_timecode;
bool printed_timecode_warning;
/* DLL - chase MTC */
double t0; ///< time at the beginning of the MTC quater frame
double t1; ///< calculated end of the MTC quater frame

View File

@ -61,6 +61,10 @@ MTC_Slave::MTC_Slave (Session& s, MIDI::Port& p)
last_mtc_fps_byte = session.get_mtc_timecode_bits ();
mtc_timecode = timecode_60; // track changes of MTC timecode
a3e_timecode = timecode_60; // track canges of Ardour's timecode
printed_timecode_warning = false;
reset (true);
rebind (p);
}
@ -332,11 +336,29 @@ MTC_Slave::update_mtc_time (const byte *msg, bool was_full, framepos_t now)
}
if (reset_tc) {
if (!did_reset_tc_format) {
saved_tc_format = session.config.get_timecode_format();
did_reset_tc_format = true;
TimecodeFormat cur_timecode = session.config.get_timecode_format();
if (0 /* TODO preferences */) {
/* enforce time-code */
if (!did_reset_tc_format) {
saved_tc_format = cur_timecode;
did_reset_tc_format = true;
}
if (cur_timecode != tc_format) {
warning << _("Session and MTC framerate mismatch.") << endmsg;
}
session.config.set_timecode_format (tc_format);
} else {
/* only warn about TC mismatch */
if (mtc_timecode != tc_format) printed_timecode_warning = false;
if (a3e_timecode != cur_timecode) printed_timecode_warning = false;
if (cur_timecode != tc_format && ! printed_timecode_warning) {
warning << _("Session and MTC framerate mismatch.") << endmsg;
printed_timecode_warning = true;
}
}
session.config.set_timecode_format (tc_format);
mtc_timecode = tc_format;
a3e_timecode = cur_timecode;
}
DEBUG_TRACE (DEBUG::MTC, string_compose ("MTC at %1 TC %2 = mtc_frame %3 (from full message ? %4)\n",