comparison audioio/AudioJACKSource.h @ 0:a6020bf991cd

* Initial import of what may or may not become a simple live visual-response host for causal Vamp plugins
author cannam
date Thu, 19 Oct 2006 16:53:48 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:a6020bf991cd
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3 #ifndef _AUDIO_JACK_SOURCE_H_
4 #define _AUDIO_JACK_SOURCE_H_
5
6 #ifdef HAVE_JACK
7
8 #include <jack/jack.h>
9 #include <vector>
10
11 #include "AudioCallbackRecordSource.h"
12
13 #include <QMutex>
14
15 class AudioCallbackRecordTarget;
16
17 class AudioJACKSource : public AudioCallbackRecordSource
18 {
19 public:
20 AudioJACKSource(AudioCallbackRecordTarget *target);
21 virtual ~AudioJACKSource();
22
23 virtual bool isOK() const;
24
25 protected:
26 int process(jack_nframes_t nframes);
27 int xrun();
28
29 static int processStatic(jack_nframes_t, void *);
30 static int xrunStatic(void *);
31
32 jack_client_t *m_client;
33 std::vector<jack_port_t *> m_inputs;
34 jack_nframes_t m_bufferSize;
35 jack_nframes_t m_sampleRate;
36 QMutex m_mutex;
37 };
38
39 #endif /* HAVE_JACK */
40
41 #endif
42