fix taglib header paths so linked headers are not necessary
[ardour.git] / libs / ardour / audioengine.cc
index 5b9d34f5e50c4cd6fc2af0926dc1eff45d00029f..583ed1ae820bf2d03cf804a608688dadb57e6da8 100644 (file)
@@ -31,8 +31,6 @@
 #include "pbd/unknown_type.h"
 #include "pbd/epa.h"
 
-#include <jack/weakjack.h>
-
 #include "midi++/port.h"
 #include "midi++/jack_midi_port.h"
 #include "midi++/mmc.h"
@@ -759,9 +757,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;
                }
@@ -1549,7 +1546,7 @@ AudioEngine::is_realtime () const
 }
 
 int
-AudioEngine::create_process_thread (boost::function<void()> f, pthread_t* thread, size_t stacksize)
+AudioEngine::create_process_thread (boost::function<void()> f, jack_native_thread_t* thread, size_t stacksize)
 {
         GET_PRIVATE_JACK_POINTER_RET (_jack, 0);
         ThreadData* td = new ThreadData (this, f, stacksize);
@@ -1562,6 +1559,28 @@ AudioEngine::create_process_thread (boost::function<void()> f, pthread_t* thread
         return 0;
 }
 
+bool
+AudioEngine::stop_process_thread (jack_native_thread_t thread)
+{
+       /**
+        * can't use GET_PRIVATE_JACK_POINTER_RET (_jack, 0) here
+        * because _jack is 0 when this is called. At least for
+        * Jack 2 _jack arg is not used so it should be OK
+        */
+
+#if defined(USING_JACK2_EXPANSION_OF_JACK_API) || defined(WIN32)
+       if (jack_client_stop_thread (_jack, thread) != 0) {
+               error << "AudioEngine: cannot stop process thread" << endmsg;
+               return false;
+       }
+#else
+       void* status;
+       pthread_join (thread, &status);
+#endif
+
+       return true;
+}
+
 void*
 AudioEngine::_start_process_thread (void* arg)
 {