Mercurial > hg > opencollidoscope
comparison CollidoscopeApp/include/BufferToWaveRecorderNode.h @ 2:dd889fff8423
added some comments
author | Fiore Martin <f.martin@qmul.ac.uk> |
---|---|
date | Mon, 11 Jul 2016 17:03:40 +0200 |
parents | 02467299402e |
children | 75b744078d66 |
comparison
equal
deleted
inserted
replaced
1:b5bcad8e7803 | 2:dd889fff8423 |
---|---|
10 | 10 |
11 typedef std::shared_ptr<class BufferToWaveRecorderNode> BufferToWaveRecorderNodeRef; | 11 typedef std::shared_ptr<class BufferToWaveRecorderNode> BufferToWaveRecorderNodeRef; |
12 | 12 |
13 typedef ci::audio::dsp::RingBufferT<RecordWaveMsg> RecordWaveMsgRingBuffer; | 13 typedef ci::audio::dsp::RingBufferT<RecordWaveMsg> RecordWaveMsgRingBuffer; |
14 | 14 |
15 | 15 /** |
16 * A \a Node in the audio graph of the Cinder audio library that records input in a buffer. | |
17 * | |
18 * This class is similar to \a cinder::audio::BufferRecorderNode (it's a derivative work of this class indeed) but it has an additional feature. | |
19 * When recording it uses the audio input samples to compute the size values of the visual chunks. | |
20 * The chunks values are stored in a ring buffer and fetched by the graphic thread to paint the wave as it gets recorded. | |
21 * | |
22 */ | |
16 class BufferToWaveRecorderNode : public ci::audio::SampleRecorderNode { | 23 class BufferToWaveRecorderNode : public ci::audio::SampleRecorderNode { |
17 public: | 24 public: |
18 | 25 |
19 static const float kRampTime; | 26 static const float kRampTime; |
20 | 27 |
52 void writeToFile(const ci::fs::path &filePath, ci::audio::SampleType sampleType = ci::audio::SampleType::INT_16); | 59 void writeToFile(const ci::fs::path &filePath, ci::audio::SampleType sampleType = ci::audio::SampleType::INT_16); |
53 | 60 |
54 //! Returns the frame of the last buffer overrun or 0 if none since the last time this method was called. When this happens, it means the recorded buffer probably has skipped some frames. | 61 //! Returns the frame of the last buffer overrun or 0 if none since the last time this method was called. When this happens, it means the recorded buffer probably has skipped some frames. |
55 uint64_t getLastOverrun(); | 62 uint64_t getLastOverrun(); |
56 | 63 |
64 //! returns a reference to the ring buffer when the size values of the chunks is stored, when a new wave is recorder | |
57 RecordWaveMsgRingBuffer& getRingBuffer() { return mRingBuffer; } | 65 RecordWaveMsgRingBuffer& getRingBuffer() { return mRingBuffer; } |
58 | 66 |
67 //!returns a pointer to the buffer where the audio is recorder. This is used by the PGranular to create the granular synthesis | |
59 ci::audio::Buffer* getRecorderBuffer() { return &mRecorderBuffer; } | 68 ci::audio::Buffer* getRecorderBuffer() { return &mRecorderBuffer; } |
60 | 69 |
61 | 70 |
62 protected: | 71 protected: |
63 void initialize() override; | 72 void initialize() override; |