00001
00025 #ifndef DEVICEUPDATER_H_INCLUDED_C419EA9C
00026 #define DEVICEUPDATER_H_INCLUDED_C419EA9C
00027
00028
00029 #include "openalpp/streamupdater.h"
00030 #include "openalpp/error.h"
00031 #include "openalpp/export.h"
00032
00033 #ifdef ALPP_USE_PORT_AUDIO
00034 #include <portaudio.h>
00035
00036 namespace openalpp {
00037
00041 class DeviceUpdater : public StreamUpdater, public ost::Semaphore {
00042 PortAudioStream *stream_;
00043 ost::Mutex inputmutex;
00044 char *tmpbuffer_;
00045 int tmpbufsize_,maxtmpbufsize_;
00046 int bytesperframe_;
00047 public:
00058 OPENALPP_API DeviceUpdater(int device, unsigned int frequency,unsigned int buffersize,
00059 SampleFormat format,
00060 ALuint buffer1,ALuint buffer2);
00061
00065 OPENALPP_API ~DeviceUpdater();
00066
00071 OPENALPP_API void run();
00072
00076 OPENALPP_API inline void Enter() {inputmutex.enterMutex();}
00077
00081 OPENALPP_API inline void Leave() {inputmutex.leaveMutex();}
00082
00089 OPENALPP_API void CopyInput(void *tempbuffer,int length);
00090 };
00091
00092 }
00093 #endif // ifdef ALPP_USE_PORTAUDIO
00094
00095 #endif