25#ifndef SRC_HEADERS_GX_JACK_H_
26#define SRC_HEADERS_GX_JACK_H_
31#include <jack/midiport.h>
32#include <jack/ringbuffer.h>
34#ifdef HAVE_JACK_SESSION
35#include <jack/session.h>
70 void push(
const char *a,
const char *b,
bool conn);
99#ifdef HAVE_JACK_SESSION
101 typedef int (*jack_set_session_callback_type)(
102 jack_client_t *, JackSessionCallback,
void *arg);
103 typedef char *(*jack_get_uuid_for_client_name_type)(
104 jack_client_t *,
const char *);
105 typedef char *(*jack_client_get_uuid_type)(jack_client_t *);
122 inline int next(
int i = -1)
const;
124 inline void fill(
unsigned char *midi_send,
int i);
129 if (
send_cc[i].load(std::memory_order_acquire)) {
142 send_cc[i].store(
false, std::memory_order_release);
163#ifdef HAVE_JACK_SESSION
164 jack_session_event_t *session_event;
165 jack_session_event_t *session_event_ins;
166 int session_callback_seen;
167 static void gx_jack_session_callback(jack_session_event_t *event,
void *arg);
168 static void gx_jack_session_callback_ins(jack_session_event_t *event,
void *arg);
169 static jack_set_session_callback_type jack_set_session_callback_fp;
170 static jack_get_uuid_for_client_name_type jack_get_uuid_for_client_name_fp;
171 static jack_client_get_uuid_type jack_client_get_uuid_fp;
231 bool send_midi_cc(
int cc_num,
int pgm_num,
int bgn,
int num);
253#ifdef HAVE_JACK_SESSION
254 jack_session_event_t *get_last_session_event() {
257 jack_session_event_t *get_last_session_event_ins() {
260 int return_last_session_event();
261 int return_last_session_event_ins();
262 string get_uuid_insert();
static int gx_jack_insert_process(jack_nframes_t, void *arg)
string client_insert_name
static void gx_jack_portreg_callback(jack_port_id_t, int, void *arg)
gx_engine::GxEngine & get_engine()
void set_jack_exit(bool v)
bool gx_jack_init(bool startserver, int wait_after_connect, const gx_system::CmdlineOptions &opt)
static string get_default_instancename()
void write_connections(gx_system::JsonWriter &w)
Glib::Dispatcher shutdown
bool send_midi_cc(int cc_num, int pgm_num, int bgn, int num)
static void gx_jack_portconn_callback(jack_port_id_t a, jack_port_id_t b, int connect, void *arg)
void write_jack_port_connections(gx_system::JsonWriter &w, const char *key, const PortConnection &pc, bool replace=false)
Glib::Dispatcher & signal_portchange()
jack_nframes_t get_jack_sr()
void set_jack_insert(bool v)
sigc::signal< void, string, string, bool > & signal_connection_changed()
const string & get_instancename()
void gx_jack_init_port_connection(const gx_system::CmdlineOptions &opt)
void * get_midi_buffer(jack_nframes_t nframes)
gx_engine::GxEngine & engine
static int gx_jack_process(jack_nframes_t, void *arg)
Glib::Dispatcher connection
Glib::Dispatcher & signal_buffersize_change()
void process_midi_cc(void *buf, jack_nframes_t nframes)
sigc::signal< void > client_change
static void shutdown_callback_client(void *arg)
Glib::Dispatcher session_ins
std::string replace_clientvar(const std::string &s)
void read_connections(gx_system::JsonParser &jp)
static int gx_jack_buffersize_callback(jack_nframes_t, void *arg)
static void shutdown_callback_client_insert(void *arg)
GxJack(gx_engine::GxEngine &engine_)
static void rt_watchdog_set_limit(int limit)
jack_transport_state_t transport_state
PortConnRing connection_queue
static int gx_jack_xrun_callback(void *arg)
Glib::Dispatcher client_change_rt
void fetch_connection_data()
jack_transport_state_t old_transport_state
sigc::signal< void > & signal_client_change()
Glib::Dispatcher buffersize_change
sigc::signal< void, string, string, bool > connection_changed
static int gx_jack_srate_callback(jack_nframes_t, void *arg)
void gx_jack_shutdown_callback()
void set_jack_down(bool v)
bool gx_jack_connection(bool connect, bool startserver, int wait_after_connect, const gx_system::CmdlineOptions &opt)
void cleanup_slot(bool otherthread)
jack_client_t * client_insert
jack_nframes_t get_time_is()
jack_nframes_t get_jack_bs()
void send_connection_changes(bool v)
int is_power_of_two(unsigned int x)
std::string make_clientvar(const std::string &s)
PortConnection midi_input
PortConnection midi_output
PortConnection insert_out
void fill(unsigned char *midi_send, int i)
int me_num[max_midi_cc_cnt]
std::atomic< bool > send_cc[max_midi_cc_cnt]
static const int max_midi_cc_cnt
bool send_midi_cc(int _cc, int _pg, int _bgn, int _num)
int pg_num[max_midi_cc_cnt]
gx_engine::GxEngine & engine
int cc_num[max_midi_cc_cnt]
int bg_num[max_midi_cc_cnt]
MidiCC(gx_engine::GxEngine &engine_)
void push(const char *a, const char *b, bool conn)
Glib::Dispatcher portchange
Glib::Dispatcher new_data
int atomic_get(volatile int &p)
void atomic_set(volatile int *p, int v)
PortConnData(const char *a, const char *b, bool conn)