Remove non-jackdbus man pages
[jackdbus.git] / tools / zalsa / jackclient.h
blob52f3ddfd249e53950e7ddd590f5a0b9d2ba57788
1 // ----------------------------------------------------------------------------
2 //
3 // Copyright (C) 2012-2018 Fons Adriaensen <fons@linuxaudio.org>
4 //
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.
9 //
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"
27 #include "lfqueue.h"
30 class Jackclient
32 public:
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,
41 Lfq_int32 *commq,
42 Lfq_adata *alsaq,
43 Lfq_jdata *infoq,
44 double ratio,
45 int delay,
46 int ltcor,
47 int rqual);
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; }
55 private:
57 bool init (const char *jserv);
58 void fini (void);
59 void initwait (int nwait);
60 void initsync (void);
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];
75 void *_arg;
76 const char *_jname;
77 int _mode;
78 int _nchan;
79 int _state;
80 int _count;
81 int _fsamp;
82 int _bsize;
83 int _rprio;
84 bool _freew;
85 float *_buff;
87 Lfq_audio *_audioq;
88 Lfq_int32 *_commq;
89 Lfq_adata *_alsaq;
90 Lfq_jdata *_infoq;
91 double _ratio;
92 int _ppsec;
93 int _bstat;
95 jack_nframes_t _ft;
96 double _t_a0;
97 double _t_a1;
98 int _k_a0;
99 int _k_a1;
100 double _delay;
101 int _ltcor;
103 double _w0;
104 double _w1;
105 double _w2;
106 double _z1;
107 double _z2;
108 double _z3;
109 double _rcorr;
110 VResampler *_resamp;
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);
120 #endif