weak/runtime jack linking: load libjack dynamically at runtime
[ardour.git] / libs / backends / jack / jack_connection.cc
index 77c86b914320162df72ffd06ebdbbe725826bba2..201769070b20980af1be15da9cac6940c0d26139 100644 (file)
@@ -19,7 +19,8 @@
 #include <iostream>
 
 #include <boost/scoped_ptr.hpp>
-#include <jack/session.h>
+
+#include <glibmm/timer.h>
 
 #include "pbd/epa.h"
 
@@ -73,7 +74,7 @@ JackConnection::JackConnection (const std::string& arg1, const std::string& arg2
         }
 
        jack_status_t status;
-       jack_client_t* c = jack_client_open ("ardourprobe", JackNoStartServer, &status);
+       jack_client_t* c = jack_client_open1 ("ardourprobe", JackNoStartServer, &status);
 
        if (status == 0) {
                jack_client_close (c);
@@ -113,7 +114,7 @@ JackConnection::open ()
        get_jack_server_dir_paths (dirs);
        set_path_env_for_jack_autostart (dirs);
 
-       if ((_jack = jack_client_open (_client_name.c_str(), JackSessionID, &status, session_uuid.c_str())) == 0) {
+       if ((_jack = jack_client_open2 (_client_name.c_str(), JackSessionID, &status, session_uuid.c_str())) == 0) {
                return -1;
        }
 
@@ -145,11 +146,7 @@ JackConnection::close ()
                _jack = 0;
 
                /* If we started JACK, it will be closing down */
-#ifdef PLATFORM_WINDOWS
-               Sleep(500);
-#else
-               usleep (500000);
-#endif
+               Glib::usleep (500000);
 
                Disconnected (""); /* EMIT SIGNAL */