diff options
Diffstat (limited to 'maximilian.h')
| -rwxr-xr-x | maximilian.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/maximilian.h b/maximilian.h index 5f1d2f7..d7d8558 100755 --- a/maximilian.h +++ b/maximilian.h @@ -796,5 +796,38 @@ public: }; +class maxiRecorder +{ +public: + maxiRecorder(); + ~maxiRecorder(); + + void setup(std::string _filename); + void startRecording(); + void stopRecording(); + bool isRecording() const; + void passData(double* _in, int _inBufferSize); + void passData(float* _in, int _inBufferSize); + void saveToWav(); + +protected: + std::vector<double> getProcessedData(); + void update(); + void enqueueBuffer(); + void freeResources(); + +private: + template <typename T> + void write(std::ofstream& _stream, const T& _t); + const int bufferQueueSize; + const int bufferSize; + long int bufferIndex; + long int recordedAmountFrames; + std::queue<double*> bufferQueue; + std::queue<double*> savedBuffers; + bool doRecord; + std::string filename; +}; + #endif |
