From f66d3f9b132599ab0ef7466740437343d3462186 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 13 Oct 2012 23:27:43 +0000 Subject: [PATCH] MTCslave - use new timecode API git-svn-id: svn://localhost/ardour2/branches/3.0@13267 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/slave.h | 1 + libs/ardour/mtc_slave.cc | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h index 48da695417..0ba06b3ba5 100644 --- a/libs/ardour/ardour/slave.h +++ b/libs/ardour/ardour/slave.h @@ -287,6 +287,7 @@ class MTC_Slave : public TimecodeSlave { double quarter_frame_duration; Timecode::TimecodeFormat mtc_timecode; Timecode::TimecodeFormat a3e_timecode; + Timecode::Time timecode; bool printed_timecode_warning; /* DLL - chase MTC */ diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc index c568cd5d6a..9e51a9ca24 100644 --- a/libs/ardour/mtc_slave.cc +++ b/libs/ardour/mtc_slave.cc @@ -281,7 +281,6 @@ MTC_Slave::update_mtc_time (const byte *msg, bool was_full, framepos_t now) */ //DEBUG_TRACE (DEBUG::MTC, string_compose ("MTC::update_mtc_time - TID:%1\n", ::pthread_self())); - Time timecode; TimecodeFormat tc_format; bool reset_tc = true; @@ -370,7 +369,12 @@ MTC_Slave::update_mtc_time (const byte *msg, bool was_full, framepos_t now) */ quarter_frame_duration = (double(session.frame_rate()) / (double) timecode.rate / 4.0); - session.timecode_to_sample (timecode, mtc_frame, true, false); // audio-frame according to Ardour's FPS + + Timecode::timecode_to_sample (timecode, mtc_frame, true, false, + double(session.frame_rate()), + session.config.get_subframes_per_frame(), + session.config.get_timecode_offset_negative(), session.config.get_timecode_offset() + ); DEBUG_TRACE (DEBUG::MTC, string_compose ("MTC at %1 TC %2 = mtc_frame %3 (from full message ? %4) tc-ratio %5\n", now, timecode, mtc_frame, was_full, speedup_due_to_tc_mismatch)); @@ -630,5 +634,10 @@ MTC_Slave::apparent_timecode_format () const std::string MTC_Slave::approximate_current_position() const { - return "88:88:88:88"; + SafeTime last; + read_current (&last); + return Timecode::timecode_format_sampletime( + last.position, + double(session.frame_rate()), + 25, false); } -- 2.30.2