00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef _AUDIO_PORT_AUDIO_TARGET_H_
00017 #define _AUDIO_PORT_AUDIO_TARGET_H_
00018
00019 #ifdef HAVE_PORTAUDIO
00020
00021
00022
00023
00024
00025 #include <portaudio.h>
00026 #include <vector>
00027
00028 #include "AudioCallbackPlayTarget.h"
00029
00030 class AudioCallbackPlaySource;
00031
00032 class AudioPortAudioTarget : public AudioCallbackPlayTarget
00033 {
00034 Q_OBJECT
00035
00036 public:
00037 AudioPortAudioTarget(AudioCallbackPlaySource *source);
00038 virtual ~AudioPortAudioTarget();
00039
00040 virtual void shutdown();
00041
00042 virtual bool isOK() const;
00043
00044 virtual double getCurrentTime() const;
00045
00046 public slots:
00047 virtual void sourceModelReplaced();
00048
00049 protected:
00050 #ifdef HAVE_PORTAUDIO_V18
00051
00052 int process(void *input, void *output, unsigned long frames,
00053 PaTimestamp outTime);
00054
00055 static int processStatic(void *, void *, unsigned long,
00056 PaTimestamp, void *);
00057
00058 PortAudioStream *m_stream;
00059
00060 #else
00061
00062 int process(const void *input, void *output, unsigned long frames,
00063 const PaStreamCallbackTimeInfo *timeInfo,
00064 PaStreamCallbackFlags statusFlags);
00065
00066 static int processStatic(const void *, void *, unsigned long,
00067 const PaStreamCallbackTimeInfo *,
00068 PaStreamCallbackFlags, void *);
00069
00070 PaStream *m_stream;
00071
00072 #endif
00073
00074 int m_bufferSize;
00075 int m_sampleRate;
00076 int m_latency;
00077 bool m_done;
00078 };
00079
00080 #endif
00081
00082 #endif
00083