1 // ----------------------------------------------------------------------------
3 // Copyright (C) 2012-2018 Fons Adriaensen <fons@linuxaudio.org>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 // ----------------------------------------------------------------------------
21 #ifndef __JACKCLIENT_H
22 #define __JACKCLIENT_H
25 #include <zita-resampler/vresampler.h>
26 #include "jack/jack.h"
34 Jackclient (jack_client_t
*, const char *jserv
, int mode
, int nchan
, bool sync
, void *arg
);
35 virtual ~Jackclient (void);
37 enum { PLAY
, CAPT
, MAXCHAN
= 64 };
38 enum { INIT
, TERM
, WAIT
, SYNC0
, SYNC1
, SYNC2
, PROC1
, PROC2
};
40 void start (Lfq_audio
*audioq
,
49 const char *jname (void) const { return _jname
; }
50 int fsamp (void) const { return _fsamp
; }
51 int bsize (void) const { return _bsize
; }
52 int rprio (void) const { return _rprio
; }
53 void *getarg(void) const { return _arg
; }
57 bool init (const char *jserv
);
59 void initwait (int nwait
);
61 void setloop (double bw
);
62 void silence (int nframes
);
63 void playback (int nframes
);
64 void capture (int nframes
);
65 void sendinfo (int state
, double error
, double ratio
);
67 virtual void thr_main (void) {}
69 void jack_freewheel (int state
);
70 void jack_latency (jack_latency_callback_mode_t jlcm
);
71 int jack_process (int nframes
);
73 jack_client_t
*_client
;
74 jack_port_t
*_ports
[MAXCHAN
];
112 static void jack_static_shutdown (void *arg
);
113 static int jack_static_buffsize (jack_nframes_t nframes
, void *arg
);
114 static void jack_static_freewheel (int state
, void *arg
);
115 static void jack_static_latency (jack_latency_callback_mode_t jlcm
, void *arg
);
116 static int jack_static_process (jack_nframes_t nframes
, void *arg
);