annotate audioio/AudioJACKTarget.h @ 20:b5a14d115240

* Make RealTimePluginInstances also provide the PluginInstance interface
author Chris Cannam
date Mon, 20 Mar 2006 13:48:58 +0000
parents c606d3ffa397
children ebe07d3560e6
rev   line source
Chris@19 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@0 2
Chris@0 3 /*
Chris@0 4 A waveform viewer and audio annotation editor.
Chris@2 5 Chris Cannam, Queen Mary University of London, 2005-2006
Chris@0 6
Chris@0 7 This is experimental software. Not for distribution.
Chris@0 8 */
Chris@0 9
Chris@0 10 #ifndef _AUDIO_JACK_TARGET_H_
Chris@0 11 #define _AUDIO_JACK_TARGET_H_
Chris@0 12
Chris@0 13 #ifdef HAVE_JACK
Chris@0 14
Chris@0 15 #include <jack/jack.h>
Chris@0 16 #include <vector>
Chris@0 17
Chris@0 18 #include "AudioCallbackPlayTarget.h"
Chris@0 19
Chris@0 20 #include <QMutex>
Chris@0 21
Chris@0 22 class AudioCallbackPlaySource;
Chris@0 23
Chris@0 24 class AudioJACKTarget : public AudioCallbackPlayTarget
Chris@0 25 {
Chris@0 26 Q_OBJECT
Chris@0 27
Chris@0 28 public:
Chris@0 29 AudioJACKTarget(AudioCallbackPlaySource *source);
Chris@0 30 virtual ~AudioJACKTarget();
Chris@0 31
Chris@0 32 virtual bool isOK() const;
Chris@0 33
Chris@0 34 public slots:
Chris@0 35 virtual void sourceModelReplaced();
Chris@0 36
Chris@0 37 protected:
Chris@0 38 int process(jack_nframes_t nframes);
Chris@0 39
Chris@0 40 static int processStatic(jack_nframes_t, void *);
Chris@0 41
Chris@0 42 jack_client_t *m_client;
Chris@0 43 std::vector<jack_port_t *> m_outputs;
Chris@0 44 jack_nframes_t m_bufferSize;
Chris@0 45 jack_nframes_t m_sampleRate;
Chris@0 46 QMutex m_mutex;
Chris@0 47 };
Chris@0 48
Chris@0 49 #endif /* HAVE_JACK */
Chris@0 50
Chris@0 51 #endif
Chris@0 52