diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/audioio/AudioJACKSource.h	Thu Oct 19 16:53:48 2006 +0000
@@ -0,0 +1,42 @@
+/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
+
+#ifndef _AUDIO_JACK_SOURCE_H_
+#define _AUDIO_JACK_SOURCE_H_
+
+#ifdef HAVE_JACK
+
+#include <jack/jack.h>
+#include <vector>
+
+#include "AudioCallbackRecordSource.h"
+
+#include <QMutex>
+
+class AudioCallbackRecordTarget;
+
+class AudioJACKSource : public AudioCallbackRecordSource
+{
+public:
+    AudioJACKSource(AudioCallbackRecordTarget *target);
+    virtual ~AudioJACKSource();
+
+    virtual bool isOK() const;
+
+protected:
+    int process(jack_nframes_t nframes);
+    int xrun();
+
+    static int processStatic(jack_nframes_t, void *);
+    static int xrunStatic(void *);
+
+    jack_client_t              *m_client;
+    std::vector<jack_port_t *>  m_inputs;
+    jack_nframes_t              m_bufferSize;
+    jack_nframes_t              m_sampleRate;
+    QMutex                      m_mutex;
+};
+
+#endif /* HAVE_JACK */
+
+#endif
+