move JACK audio backend to its own folder and adjust build system to reflect that...
[ardour.git] / libs / backends / jack / jack_connection.h
1 #ifndef __libardour_jack_connection_h__
2 #define __libardour_jack_connection_h__
3
4 #include <string>
5 #include <jack/jack.h>
6
7 #include "pbd/signals.h"
8
9 namespace ARDOUR {
10
11 class JackConnection {
12   public:
13     JackConnection (const std::string& client_name, const std::string& session_uuid);
14     ~JackConnection ();
15
16     const std::string& client_name() const { return _client_name; }
17
18     int open ();
19     int close ();
20     bool connected () const { return _jack != 0; }
21
22     jack_client_t* jack() const { return _jack; }
23
24     PBD::Signal0<void> Connected;
25     PBD::Signal1<void,const char*> Disconnected;
26
27     void halted_callback ();
28     void halted_info_callback (jack_status_t, const char*);
29
30     static bool server_running();
31
32   private:
33     jack_client_t* volatile _jack;
34     std::string _client_name;
35     std::string session_uuid;
36 };
37
38 } // namespace 
39
40 #endif /* __libardour_jack_connection_h__ */