view 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 source
/* -*- 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