diff options
| author | Leon Fedden <lfedd001@gold.ac.uk> | 2016-10-11 10:47:28 +0100 |
|---|---|---|
| committer | Leon Fedden <lfedd001@gold.ac.uk> | 2016-10-11 10:47:28 +0100 |
| commit | 3a48a1708930139c806b5b3a14ca57b8ad2a3a41 (patch) | |
| tree | 168e72b721f5245ddd65bf17022aa5bf35b71e2f /maximilian.h | |
| parent | 7f4bec02beedeb71725c65191b8d76f24b56b9a3 (diff) | |
adding maxiRecorder
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 |
