Formatting only.
[ardour.git] / libs / ardour / audioengine.cc
index 2c57949074e2e4551cb45bccb531fb82fbe6042b..08de54960c0ae1a6972f3d0aaccade1850e1ff9c 100644 (file)
@@ -227,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 */
                }
        }
 
@@ -521,15 +521,6 @@ AudioEngine::process_callback (pframes_t nframes)
        }
 
        if (_session == 0) {
-#ifdef HAVE_LTC
-               // silence LTC
-               jack_default_audio_sample_t *out;
-               boost::shared_ptr<Port> ltcport = ltc_output_port();
-               if (ltcport && ltcport->jack_port()) {
-                       out = (jack_default_audio_sample_t*) jack_port_get_buffer (ltcport->jack_port(), nframes);
-                       if (out) memset(out, 0, nframes * sizeof(jack_default_audio_sample_t));
-               }
-#endif
 
                if (!_freewheeling) {
                        MIDI::Manager::instance()->cycle_start(nframes);
@@ -556,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);
@@ -771,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;
                }
@@ -1139,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:
@@ -1171,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 */
        }
 }
 
@@ -1419,8 +1407,8 @@ AudioEngine::disconnect_from_jack ()
 
        if (_running) {
                _running = false;
-               Stopped(); /* EMIT SIGNAL */
                MIDI::JackMIDIPort::JackHalted (); /* EMIT SIGNAL */
+               Stopped(); /* EMIT SIGNAL */
        }
 
        return 0;