yet another meter+monitoring detail:
[ardour.git] / libs / ardour / audioengine.cc
index cc04c343e1de7672fe83102601133a796196f23b..08de54960c0ae1a6972f3d0aaccade1850e1ff9c 100644 (file)
@@ -78,7 +78,6 @@ AudioEngine::AudioEngine (string client_name, string session_uuid)
        , port_remove_in_progress (false)
        , m_meter_thread (0)
        , _main_thread (0)
-       , _ltc_input ()
        , ports (new Ports)
 {
        _instance = this; /* singleton */
@@ -90,18 +89,6 @@ AudioEngine::AudioEngine (string client_name, string session_uuid)
        }
 
        Port::set_engine (this);
-
-#ifdef HAVE_LTC
-       _ltc_input = register_port (DataType::AUDIO, _("LTC in"), true);
-
-       /* As of October 2012, the LTC source port is the only thing that needs
-        * to care about Config parameters, so don't bother to listen if we're
-        * not doing LTC stuff. This might change if other parameters show up
-        * in the future that we need to care about with or without LTC.
-        */
-
-       Config->ParameterChanged.connect_same_thread (config_connection, boost::bind (&AudioEngine::parameter_changed, this, _1));
-#endif
 }
 
 AudioEngine::~AudioEngine ()
@@ -222,9 +209,6 @@ AudioEngine::start ()
                        _running = true;
                        _has_run = true;
                        Running(); /* EMIT SIGNAL */
-
-                       reconnect_ltc ();
-
                } else {
                        // error << _("cannot activate JACK client") << endmsg;
                }
@@ -243,8 +227,8 @@ AudioEngine::stop (bool forever)
                        disconnect_from_jack ();
                } else {
                        jack_deactivate (_priv_jack);
-                       Stopped(); /* EMIT SIGNAL */
                        MIDI::JackMIDIPort::JackHalted (); /* EMIT SIGNAL */
+                       Stopped(); /* EMIT SIGNAL */
                }
        }
 
@@ -563,16 +547,13 @@ AudioEngine::process_callback (pframes_t nframes)
        }
 
        /* test if we are freewheeling and there are freewheel signals connected.
-           ardour should act normally even when freewheeling unless /it/ is exporting */
-
+           ardour should act normally even when freewheeling unless /it/ is
+           exporting 
+       */
 
        if (_freewheeling && !Freewheel.empty()) {
-               /* emit the Freewheel signal and stop freewheeling in the event of trouble
-                */
-                boost::optional<int> r = Freewheel (nframes);
-               if (r.get_value_or (0)) {
-                       jack_set_freewheel (_priv_jack, false);
-               }
+
+                Freewheel (nframes);
 
        } else {
                MIDI::Manager::instance()->cycle_start(nframes);
@@ -778,9 +759,8 @@ void
 AudioEngine::meter_thread ()
 {
        pthread_set_name (X_("meter"));
-
        while (true) {
-               Glib::usleep (10000); /* 1/100th sec interval */
+               Glib::usleep (10000);
                if (g_atomic_int_get(&m_meter_exit)) {
                        break;
                }
@@ -1146,6 +1126,7 @@ AudioEngine::halted_info (jack_status_t code, const char* reason, void *arg)
         ae->_jack = 0;
 
         if (was_running) {
+               MIDI::JackMIDIPort::JackHalted (); /* EMIT SIGNAL */
 #ifdef HAVE_JACK_ON_INFO_SHUTDOWN
                 switch (code) {
                 case JackBackendError:
@@ -1178,8 +1159,8 @@ AudioEngine::halted (void *arg)
         ae->_jack = 0;
 
        if (was_running) {
-               ae->Halted(""); /* EMIT SIGNAL */
                MIDI::JackMIDIPort::JackHalted (); /* EMIT SIGNAL */
+               ae->Halted(""); /* EMIT SIGNAL */
        }
 }
 
@@ -1426,8 +1407,8 @@ AudioEngine::disconnect_from_jack ()
 
        if (_running) {
                _running = false;
-               Stopped(); /* EMIT SIGNAL */
                MIDI::JackMIDIPort::JackHalted (); /* EMIT SIGNAL */
+               Stopped(); /* EMIT SIGNAL */
        }
 
        return 0;
@@ -1492,8 +1473,6 @@ AudioEngine::reconnect_to_jack ()
 
        MIDI::Manager::instance()->reconnect ();
 
-       reconnect_ltc ();
-
        Running (); /* EMIT SIGNAL*/
 
        start_metering_thread ();
@@ -1638,26 +1617,3 @@ AudioEngine::destroy ()
        _instance = 0;
 }
 
-void
-AudioEngine::parameter_changed (const std::string& s)
-{
-       if (s == "ltc-source-port") {
-               reconnect_ltc ();
-       }
-
-}
-
-void
-AudioEngine::reconnect_ltc ()
-{
-       if (_ltc_input) {
-
-               string src = Config->get_ltc_source_port();
-
-               _ltc_input->disconnect_all ();
-
-               if (src != _("None") && !src.empty())  {
-                       _ltc_input->connect (src);
-               }
-       }
-}