OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 14 matching lines...) Expand all Loading... |
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 */ | 27 */ |
28 | 28 |
29 #ifndef ReverbAccumulationBuffer_h | 29 #ifndef ReverbAccumulationBuffer_h |
30 #define ReverbAccumulationBuffer_h | 30 #define ReverbAccumulationBuffer_h |
31 | 31 |
32 #include "platform/PlatformExport.h" | 32 #include "platform/PlatformExport.h" |
33 #include "platform/audio/AudioArray.h" | 33 #include "platform/audio/AudioArray.h" |
34 | 34 |
35 namespace WebCore { | 35 namespace blink { |
36 | 36 |
37 // ReverbAccumulationBuffer is a circular delay buffer with one client reading f
rom it and multiple clients | 37 // ReverbAccumulationBuffer is a circular delay buffer with one client reading f
rom it and multiple clients |
38 // writing/accumulating to it at different delay offsets from the read position.
The read operation will zero the memory | 38 // writing/accumulating to it at different delay offsets from the read position.
The read operation will zero the memory |
39 // just read from the buffer, so it will be ready for accumulation the next time
around. | 39 // just read from the buffer, so it will be ready for accumulation the next time
around. |
40 class PLATFORM_EXPORT ReverbAccumulationBuffer { | 40 class PLATFORM_EXPORT ReverbAccumulationBuffer { |
41 public: | 41 public: |
42 ReverbAccumulationBuffer(size_t length); | 42 ReverbAccumulationBuffer(size_t length); |
43 | 43 |
44 // This will read from, then clear-out numberOfFrames | 44 // This will read from, then clear-out numberOfFrames |
45 void readAndClear(float* destination, size_t numberOfFrames); | 45 void readAndClear(float* destination, size_t numberOfFrames); |
(...skipping 10 matching lines...) Expand all Loading... |
56 size_t readTimeFrame() const { return m_readTimeFrame; } | 56 size_t readTimeFrame() const { return m_readTimeFrame; } |
57 | 57 |
58 void reset(); | 58 void reset(); |
59 | 59 |
60 private: | 60 private: |
61 AudioFloatArray m_buffer; | 61 AudioFloatArray m_buffer; |
62 size_t m_readIndex; | 62 size_t m_readIndex; |
63 size_t m_readTimeFrame; // for debugging (frame on continuous timeline) | 63 size_t m_readTimeFrame; // for debugging (frame on continuous timeline) |
64 }; | 64 }; |
65 | 65 |
66 } // namespace WebCore | 66 } // namespace blink |
67 | 67 |
68 #endif // ReverbAccumulationBuffer_h | 68 #endif // ReverbAccumulationBuffer_h |
OLD | NEW |