+ void init_mtc_dll(framepos_t, double);
+ void init_engine_dll (framepos_t, framepos_t);
+ void parse_timecode_offset();
+ void parameter_changed(std::string const & p);
+};
+
+#ifdef HAVE_LTC
+class LTC_Slave : public TimecodeSlave {
+public:
+ LTC_Slave (Session&);
+ ~LTC_Slave ();
+
+ bool speed_and_position (double&, framepos_t&);
+
+ bool locked() const;
+ bool ok() const;
+
+ framecnt_t resolution () const;
+ bool requires_seekahead () const { return false; }
+ framecnt_t seekahead_distance () const { return 0; }
+ bool give_slave_full_control_over_transport_speed() const { return true; }
+
+ Timecode::TimecodeFormat apparent_timecode_format() const;
+ std::string approximate_current_position() const;
+ std::string approximate_current_delta() const;
+
+ private:
+ void parse_ltc(const jack_nframes_t, const jack_default_audio_sample_t * const, const framecnt_t);
+ void process_ltc(framepos_t const);
+ void init_engine_dll (framepos_t, int32_t);
+ bool detect_discontinuity(LTCFrameExt *, int, bool);
+ bool detect_ltc_fps(int, bool);
+ bool equal_ltc_frame_time(LTCFrame *a, LTCFrame *b);
+ void reset();
+ void resync_xrun();
+ void resync_latency();
+ void parse_timecode_offset();
+ void parameter_changed(std::string const & p);
+
+ Session& session;
+ bool did_reset_tc_format;
+ Timecode::TimecodeFormat saved_tc_format;
+
+ LTCDecoder * decoder;
+ double frames_per_ltc_frame;
+ Timecode::Time timecode;
+ LTCFrameExt prev_frame;
+ bool fps_detected;
+
+ framecnt_t monotonic_cnt;
+ framecnt_t last_timestamp;
+ framecnt_t last_ltc_frame;
+ double ltc_speed;
+ frameoffset_t current_delta;
+ int delayedlocked;
+
+ int ltc_detect_fps_cnt;
+ int ltc_detect_fps_max;
+ bool printed_timecode_warning;
+ Timecode::TimecodeFormat ltc_timecode;
+ Timecode::TimecodeFormat a3e_timecode;
+
+ PBD::ScopedConnectionList port_connections;
+ PBD::ScopedConnection config_connection;
+ jack_latency_range_t ltc_slave_latency;
+
+ /* DLL - chase LTC */
+ int transport_direction;
+ int engine_dll_initstate;
+ 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; ///< DLL filter coefficients