From 5eeecf82a0432c1ed951886539a7331c71c15af9 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 12 Oct 2012 21:28:08 +0000 Subject: LTC slave - basic working version (hardcoded 25fps) git-svn-id: svn://localhost/ardour2/branches/3.0@13263 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/ardour/debug.h | 1 + libs/ardour/ardour/slave.h | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'libs/ardour/ardour') diff --git a/libs/ardour/ardour/debug.h b/libs/ardour/ardour/debug.h index 334aac53e6..dd76f14603 100644 --- a/libs/ardour/ardour/debug.h +++ b/libs/ardour/ardour/debug.h @@ -39,6 +39,7 @@ namespace PBD { extern uint64_t Graph; extern uint64_t Destruction; extern uint64_t MTC; + extern uint64_t LTC; extern uint64_t Transport; extern uint64_t Slave; extern uint64_t SessionEvents; diff --git a/libs/ardour/ardour/slave.h b/libs/ardour/ardour/slave.h index fa75ba17bb..24fd79c943 100644 --- a/libs/ardour/ardour/slave.h +++ b/libs/ardour/ardour/slave.h @@ -310,7 +310,7 @@ class MTC_Slave : public TimecodeSlave { #ifdef HAVE_LTC class LTC_Slave : public TimecodeSlave { - public: +public: LTC_Slave (Session&); ~LTC_Slave (); @@ -327,19 +327,27 @@ class LTC_Slave : public TimecodeSlave { Timecode::TimecodeFormat apparent_timecode_format() const; private: - int parse_ltc(const jack_nframes_t nframes, const jack_default_audio_sample_t * const in, const framecnt_t posinfo); - void process_ltc(); + int parse_ltc(const jack_nframes_t, const jack_default_audio_sample_t * const, const framecnt_t); + bool process_ltc(framepos_t, framecnt_t); + void init_ltc_dll(framepos_t, double); Session& session; bool did_reset_tc_format; Timecode::TimecodeFormat saved_tc_format; - LTCDecoder *decoder; - framecnt_t current_frames_per_ltc_frame; - framecnt_t monotonic_fcnt; + LTCDecoder *decoder; + double frames_per_ltc_frame; + framecnt_t last_timestamp; + framecnt_t last_ltc_frame; framepos_t ltc_transport_pos; double ltc_speed; + + /* DLL - chase MTC */ + double t0; ///< time at the beginning of the MTC quater frame + double t1; ///< calculated end of the MTC quater frame + double e2; ///< second order loop error + double b, c, omega; ///< DLL filter coefficients }; #endif -- cgit v1.2.3