2013-07-29 23:41:41 -04:00
|
|
|
#ifndef __libardour_jack_connection_h__
|
|
|
|
#define __libardour_jack_connection_h__
|
|
|
|
|
|
|
|
#include <string>
|
2014-10-23 07:01:45 -04:00
|
|
|
#include "weak_libjack.h"
|
2013-07-29 23:41:41 -04:00
|
|
|
|
|
|
|
#include "pbd/signals.h"
|
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
|
|
|
|
class JackConnection {
|
|
|
|
public:
|
|
|
|
JackConnection (const std::string& client_name, const std::string& session_uuid);
|
|
|
|
~JackConnection ();
|
|
|
|
|
2013-07-31 19:47:20 -04:00
|
|
|
const std::string& client_name() const { return _client_name; }
|
|
|
|
|
2013-07-29 23:41:41 -04:00
|
|
|
int open ();
|
|
|
|
int close ();
|
|
|
|
bool connected () const { return _jack != 0; }
|
|
|
|
|
|
|
|
jack_client_t* jack() const { return _jack; }
|
|
|
|
|
2024-10-18 12:01:28 -04:00
|
|
|
PBD::Signal<void()> Connected;
|
|
|
|
PBD::Signal<void(const char*)> Disconnected;
|
2013-07-29 23:41:41 -04:00
|
|
|
|
|
|
|
void halted_callback ();
|
|
|
|
void halted_info_callback (jack_status_t, const char*);
|
|
|
|
|
2013-09-25 22:56:28 -04:00
|
|
|
static bool in_control() { return _in_control; }
|
2013-08-03 11:57:56 -04:00
|
|
|
|
2015-06-14 12:10:31 -04:00
|
|
|
uint32_t probed_buffer_size () const { assert (!connected ()); return _probed_buffer_size; }
|
|
|
|
uint32_t probed_sample_rate () const { assert (!connected ()); return _probed_sample_rate; }
|
|
|
|
|
2013-07-29 23:41:41 -04:00
|
|
|
private:
|
|
|
|
jack_client_t* volatile _jack;
|
2013-07-31 19:47:20 -04:00
|
|
|
std::string _client_name;
|
2013-07-29 23:41:41 -04:00
|
|
|
std::string session_uuid;
|
2013-09-25 22:56:28 -04:00
|
|
|
static bool _in_control;
|
2015-06-14 12:10:31 -04:00
|
|
|
uint32_t _probed_buffer_size; // when not in control
|
|
|
|
uint32_t _probed_sample_rate; // when not in control
|
2013-07-29 23:41:41 -04:00
|
|
|
};
|
|
|
|
|
2015-10-04 14:51:05 -04:00
|
|
|
} // namespace
|
2013-07-29 23:41:41 -04:00
|
|
|
|
|
|
|
#endif /* __libardour_jack_connection_h__ */
|