UtiLite  0.3.1
A lite utilities library
audio/include/utilite/UAudioCaptureFile.h
Go to the documentation of this file.
00001 
00007 #ifndef UFILEAUDIORECORDER_H
00008 #define UFILEAUDIORECORDER_H
00009 
00010 #include "utilite/UtiLiteAudioExp.h" // DLL export/import defines
00011 
00012 #include "utilite/UAudioCapture.h"
00013 #include <string>
00014 
00015 class FMOD_SOUND;
00016 class FMOD_CHANNEL;
00017 
00041 class UTILITEAUDIO_EXP UAudioCaptureFile : public UAudioCapture
00042 {
00043 public:
00044     UAudioCaptureFile(const std::string &fileName, 
00045                  bool playSoundWhileRecording = false,
00046                                  int frameLength = 1024);
00047 
00048     virtual ~UAudioCaptureFile();
00049 
00050     const std::string &getFileName() const {return _fileName;}
00051     void setPositionMs(unsigned int pos);
00052 
00053     virtual bool init();
00054     virtual void close();
00055 
00056 protected:
00057     virtual void mainLoopBegin();
00058     virtual void mainLoop();
00059     virtual void mainLoopEnd();
00060 
00061 private:
00062     std::string _fileName;
00063     FMOD_SOUND * _sound;
00064     unsigned int _soundLength;
00065 
00066     bool _playSoundWhileRecording;
00067     unsigned int _dataLength;
00068         unsigned int _lastRecordPos;
00069         FMOD_CHANNEL * _channel;
00070 };
00071 
00072 #endif
 All Classes Files Functions Variables Enumerations Friends Defines