diff options
Diffstat (limited to 'libs/ardour/mtc_slave.cc')
-rw-r--r-- | libs/ardour/mtc_slave.cc | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc index 0caa86196a..a86a3e9014 100644 --- a/libs/ardour/mtc_slave.cc +++ b/libs/ardour/mtc_slave.cc @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #include <errno.h> @@ -42,6 +41,8 @@ using namespace PBD; MTC_Slave::MTC_Slave (Session& s, MIDI::Port& p) : session (s) { + can_notify_on_unknown_rate = true; + rebind (p); reset (); } @@ -94,8 +95,39 @@ MTC_Slave::update_mtc_time (const byte *msg, bool was_full) smpte.minutes = msg[2]; smpte.seconds = msg[1]; smpte.frames = msg[0]; - - session.smpte_to_sample( smpte, mtc_frame, true, false ); + + switch (msg[4]) { + case MTC_24_FPS: + smpte.rate = 24; + smpte.drop = false; + can_notify_on_unknown_rate = true; + break; + case MTC_25_FPS: + smpte.rate = 25; + smpte.drop = false; + can_notify_on_unknown_rate = true; + break; + case MTC_30_FPS_DROP: + smpte.rate = 30; + smpte.drop = true; + can_notify_on_unknown_rate = true; + break; + case MTC_30_FPS: + smpte.rate = 30; + smpte.drop = false; + can_notify_on_unknown_rate = true; + break; + default: + /* throttle error messages about unknown MTC rates */ + if (can_notify_on_unknown_rate) { + error << _("Unknown rate/drop value in incoming MTC stream, session values used instead") << endmsg; + can_notify_on_unknown_rate = false; + } + smpte.rate = session.smpte_frames_per_second(); + smpte.drop = session.smpte_drop_frames(); + } + + session.smpte_to_sample (smpte, mtc_frame, true, false); if (was_full) { |