Mercurial > hg > svapp
comparison audioio/AudioJACKTarget.h @ 43:3c5756fb6a68
* Move some things around to facilitate plundering libraries for other
applications without needing to duplicate so much code.
sv/osc -> data/osc
sv/audioio -> audioio
sv/transform -> plugin/transform
sv/document -> document (will rename to framework in next commit)
author | Chris Cannam |
---|---|
date | Wed, 24 Oct 2007 16:34:31 +0000 |
parents | |
children | 716e9d2f91c7 89a689720ee9 |
comparison
equal
deleted
inserted
replaced
42:0619006a1ee3 | 43:3c5756fb6a68 |
---|---|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ | |
2 | |
3 /* | |
4 Sonic Visualiser | |
5 An audio file viewer and annotation editor. | |
6 Centre for Digital Music, Queen Mary, University of London. | |
7 This file copyright 2006 Chris Cannam. | |
8 | |
9 This program is free software; you can redistribute it and/or | |
10 modify it under the terms of the GNU General Public License as | |
11 published by the Free Software Foundation; either version 2 of the | |
12 License, or (at your option) any later version. See the file | |
13 COPYING included with this distribution for more information. | |
14 */ | |
15 | |
16 #ifndef _AUDIO_JACK_TARGET_H_ | |
17 #define _AUDIO_JACK_TARGET_H_ | |
18 | |
19 #ifdef HAVE_JACK | |
20 | |
21 #include <jack/jack.h> | |
22 #include <vector> | |
23 | |
24 #include "AudioCallbackPlayTarget.h" | |
25 | |
26 #include <QMutex> | |
27 | |
28 class AudioCallbackPlaySource; | |
29 | |
30 class AudioJACKTarget : public AudioCallbackPlayTarget | |
31 { | |
32 Q_OBJECT | |
33 | |
34 public: | |
35 AudioJACKTarget(AudioCallbackPlaySource *source); | |
36 virtual ~AudioJACKTarget(); | |
37 | |
38 virtual bool isOK() const; | |
39 | |
40 public slots: | |
41 virtual void sourceModelReplaced(); | |
42 | |
43 protected: | |
44 int process(jack_nframes_t nframes); | |
45 int xrun(); | |
46 | |
47 static int processStatic(jack_nframes_t, void *); | |
48 static int xrunStatic(void *); | |
49 | |
50 jack_client_t *m_client; | |
51 std::vector<jack_port_t *> m_outputs; | |
52 jack_nframes_t m_bufferSize; | |
53 jack_nframes_t m_sampleRate; | |
54 QMutex m_mutex; | |
55 }; | |
56 | |
57 #endif /* HAVE_JACK */ | |
58 | |
59 #endif | |
60 |