- session.Xrun.connect_same_thread (port_connections, boost::bind (<C_Slave::resync_xrun, this));
- session.engine().GraphReordered.connect_same_thread (port_connections, boost::bind (<C_Slave::resync_latency, this));
+
+ AudioEngine::instance()->Xrun.connect_same_thread (port_connections, boost::bind (<C_TransportMaster::resync_xrun, this));
+ AudioEngine::instance()->GraphReordered.connect_same_thread (port_connections, boost::bind (<C_TransportMaster::resync_latency, this));
+}
+
+void
+LTC_TransportMaster::init ()
+{
+ reset (true);
+}
+
+void
+LTC_TransportMaster::set_session (Session *s)
+{
+ config_connection.disconnect ();
+ _session = s;
+
+ if (_session) {
+
+ samples_per_ltc_frame = _session->samples_per_timecode_frame();
+ timecode.rate = _session->timecode_frames_per_second();
+ timecode.drop = _session->timecode_drop_frames();
+ printed_timecode_warning = false;
+ ltc_timecode = _session->config.get_timecode_format();
+ a3e_timecode = _session->config.get_timecode_format();
+
+ if (Config->get_use_session_timecode_format() && _session) {
+ samples_per_timecode_frame = _session->samples_per_timecode_frame();
+ }
+
+ if (decoder) {
+ ltc_decoder_free (decoder);
+ }
+
+ decoder = ltc_decoder_create((int) samples_per_ltc_frame, 128 /*queue size*/);
+
+ parse_timecode_offset();
+ reset();
+
+ _session->config.ParameterChanged.connect_same_thread (config_connection, boost::bind (<C_TransportMaster::parameter_changed, this, _1));
+ }