Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <iostream>
#include <boost/scoped_ptr.hpp>
-#include <jack/session.h>
+
+#include <glibmm/timer.h>
#include "pbd/epa.h"
using std::cerr;
using std::endl;
+bool JackConnection::_in_control = false;
+
static void jack_halted_callback (void* arg)
{
JackConnection* jc = static_cast<JackConnection*> (arg);
, _client_name (arg1)
, session_uuid (arg2)
{
-}
-
-JackConnection::~JackConnection ()
-{
- close ();
-}
+ /* See if the server is already up
+ */
-bool
-JackConnection::server_running ()
-{
EnvironmentalProtectionAgency* global_epa = EnvironmentalProtectionAgency::get_global_epa ();
boost::scoped_ptr<EnvironmentalProtectionAgency> current_epa;
}
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);
- return true;
+ _in_control = false;
+ } else {
+ _in_control = true;
}
+}
- return false;
+JackConnection::~JackConnection ()
+{
+ close ();
}
int
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;
}
if (_priv_jack) {
int ret = jack_client_close (_priv_jack);
_jack = 0;
+
+ /* If we started JACK, it will be closing down */
+ Glib::usleep (500000);
+
Disconnected (""); /* EMIT SIGNAL */
+
return ret;
}