From 3a48a1708930139c806b5b3a14ca57b8ad2a3a41 Mon Sep 17 00:00:00 2001 From: Leon Fedden Date: Tue, 11 Oct 2016 10:47:28 +0100 Subject: adding maxiRecorder --- maximilian.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'maximilian.h') 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 getProcessedData(); + void update(); + void enqueueBuffer(); + void freeResources(); + +private: + template + void write(std::ofstream& _stream, const T& _t); + const int bufferQueueSize; + const int bufferSize; + long int bufferIndex; + long int recordedAmountFrames; + std::queue bufferQueue; + std::queue savedBuffers; + bool doRecord; + std::string filename; +}; + #endif -- cgit v1.3