1
// ----------------------------------------------------------------------------
3
// Copyright (C) 2007-2010 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 2 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, write to the Free Software
17
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
// ----------------------------------------------------------------------------
26
#include <clthreads.h>
27
#include <jack/jack.h>
28
#include "abprocess.h"
29
#include "kmeterdsp.h"
34
class Jclient : public A_thread
38
Jclient (const char *jname);
41
enum { METER_INP, METER_MON };
42
enum { MONIT_REC, MONIT_EXT };
44
const char *jname (void) const { return _jname; }
46
void set_hpfil (float v) { _abproc.set_hpfil (v); }
47
void set_mute (int m) { _abproc.set_mute (m); }
48
void set_invb (int m) { _abproc.set_invb (m); }
49
void set_endf (int m) { _abproc.set_endf (m); }
53
_virtmic.set_form (k);
55
int set_lffilt (ABconfig *C) { return _abproc.set_lffilt (C); }
56
int set_matrix (ABconfig *C) { return _abproc.set_matrix (C); }
57
int set_convol (ABconfig *C) { return _abproc.set_convol (C); }
58
int set_hffilt (ABconfig *C) { return _abproc.set_hffilt (C); }
60
void set_meter (int k) { _meter = k; }
61
void set_monit (int k) { _monit = k; }
62
void set_azim (float v) { _virtmic.set_azim (v); }
63
void set_elev (float v) { _virtmic.set_elev (v); }
64
void set_angle (float v) { _virtmic.set_angle (v); }
65
void set_direc (float v) { _virtmic.set_direc (v); }
66
void set_xtalk (bool b) { _virtmic.set_xtalk (b); }
67
void set_mono (bool b) { _virtmic.set_mono (b); }
68
void set_volum (float v) { _voldb1 = v; }
70
void get_level (int i, float *rms, float *dpk) { _kmdsp [i].read (rms, dpk); }
74
enum { S_IDLE, S_PROC };
76
virtual void thr_main (void) {}
78
void init_jack (void);
79
void init_proc (void);
80
void close_jack (void);
81
void jack_shutdown (void);
82
int jack_process (jack_nframes_t nframes);
83
void monitor (unsigned int n, float *p [4]);
84
void measure (unsigned int n, float *p [4]);
86
jack_client_t *_jack_client;
87
jack_port_t *_jack_ipports [8];
88
jack_port_t *_jack_opports [10];
104
Kmeterdsp _kmdsp [4];
106
static void jack_static_shutdown (void *arg);
107
static int jack_static_process (jack_nframes_t nframes, void *arg);
108
static const char *ipp_names [8];
109
static const char *opp_names [10];