2
Copyright (C) 2003-2005 Fons Adriaensen <fons.adriaensen@skynet.be>
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25
#include <clthreads.h>
26
#include <clalsadrv.h>
27
#include <jack/jack.h>
35
class Audio : public A_thread
39
Audio (const char *name);
40
virtual ~Audio (void);
42
void init_alsa (int ncapt, int nplay, bool bform, const char *device, int fsamp, int fsize, int nfrag);
43
void init_jack (int ncapt, int nplay, bool bform);
45
int policy (void) const { return _policy; }
46
int prioty (void) const { return _prioty; }
47
Lfq_u32 *qnote (void) { return &_qnote; }
48
Lfq_u32 *qcomm (void) { return &_qcomm; }
52
enum { VOLUME, REVSIZE, REVTIME, STPOSIT };
54
void init_audio (void);
55
void close_alsa (void);
56
void close_jack (void);
57
// void update_div (unsigned int, unsigned int);
58
// void update_all (unsigned int *, unsigned int *);
60
virtual void thr_main (void);
61
void jack_shutdown (void);
62
int jack_callback (jack_nframes_t);
64
void proc_comm (Lfq_u32 *);
65
void proc_mesg (void);
66
void proc_synth (unsigned long);
67
void proc_update (void);
69
void note_off (int n, int b)
75
void note_on (int n, int b)
81
static void jack_static_shutdown (void *);
82
static int jack_static_callback (jack_nframes_t, void *);
85
volatile bool _run_alsa;
86
volatile bool _run_jack;
87
Alsa_driver *_alsa_handle;
88
jack_client_t *_jack_handle;
89
jack_port_t *_jack_in [8];
90
jack_port_t *_jack_out [8];
102
Asection *_asectp [NASECT];
103
Division *_divisp [NDIVIS];
106
unsigned char _keys [NNOTES];