Mercurial > hg > vamp-live-host
diff audioio/AudioPortAudioSource.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/AudioPortAudioSource.h Thu Oct 19 16:53:48 2006 +0000 @@ -0,0 +1,40 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +#ifndef _AUDIO_PORT_AUDIO_SOURCE_H_ +#define _AUDIO_PORT_AUDIO_SOURCE_H_ + +#ifdef HAVE_PORTAUDIO + +#include <portaudio.h> +#include <vector> + +#include "AudioCallbackRecordSource.h" + +class AudioCallbackRecordTarget; + +class AudioPortAudioSource : public AudioCallbackRecordSource +{ +public: + AudioPortAudioSource(AudioCallbackRecordTarget *source); + virtual ~AudioPortAudioSource(); + + virtual bool isOK() const; + +protected: + int process(void *input, void *output, unsigned long frames, + PaTimestamp outTime); + + static int processStatic(void *, void *, unsigned long, + PaTimestamp, void *); + + PortAudioStream *m_stream; + + int m_bufferSize; + int m_sampleRate; + int m_latency; +}; + +#endif /* HAVE_PORTAUDIO */ + +#endif +