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:
parent
2b1cc9656e
commit
915797fd23
@ -260,6 +260,10 @@ class MTC_Slave : public Slave {
|
|||||||
int busy_guard1;
|
int busy_guard1;
|
||||||
int busy_guard2;
|
int busy_guard2;
|
||||||
|
|
||||||
|
TimecodeFormat mtc_timecode;
|
||||||
|
TimecodeFormat a3e_timecode;
|
||||||
|
bool printed_timecode_warning;
|
||||||
|
|
||||||
/* DLL - chase MTC */
|
/* DLL - chase MTC */
|
||||||
double t0; ///< time at the beginning of the MTC quater frame
|
double t0; ///< time at the beginning of the MTC quater frame
|
||||||
double t1; ///< calculated end of the MTC quater frame
|
double t1; ///< calculated end of the MTC quater frame
|
||||||
|
@ -61,6 +61,10 @@ MTC_Slave::MTC_Slave (Session& s, MIDI::Port& p)
|
|||||||
|
|
||||||
last_mtc_fps_byte = session.get_mtc_timecode_bits ();
|
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);
|
reset (true);
|
||||||
rebind (p);
|
rebind (p);
|
||||||
}
|
}
|
||||||
@ -332,11 +336,29 @@ MTC_Slave::update_mtc_time (const byte *msg, bool was_full, framepos_t now)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (reset_tc) {
|
if (reset_tc) {
|
||||||
if (!did_reset_tc_format) {
|
TimecodeFormat cur_timecode = session.config.get_timecode_format();
|
||||||
saved_tc_format = session.config.get_timecode_format();
|
if (0 /* TODO preferences */) {
|
||||||
did_reset_tc_format = true;
|
/* 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",
|
DEBUG_TRACE (DEBUG::MTC, string_compose ("MTC at %1 TC %2 = mtc_frame %3 (from full message ? %4)\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user