summaryrefslogtreecommitdiff
path: root/libs/ardour/mtc_slave.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-02-23 13:40:09 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-02-23 13:40:09 +0000
commit3ecf8cd00838293b79832b6124312c0b294fdc0f (patch)
tree140c25457bfb2ccfeaec4c313a8796e99f606f91 /libs/ardour/mtc_slave.cc
parentdfa996f8be7ca8dfbcabed81379390a3825e48f0 (diff)
possible fix for MTC slaving
git-svn-id: svn://localhost/ardour2/trunk@1498 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/mtc_slave.cc')
-rw-r--r--libs/ardour/mtc_slave.cc37
1 files changed, 35 insertions, 2 deletions
diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc
index d241636785..a86a3e9014 100644
--- a/libs/ardour/mtc_slave.cc
+++ b/libs/ardour/mtc_slave.cc
@@ -41,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 ();
}
@@ -93,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) {