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 16 matching lines...) Expand all Loading... |
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 #include "wtf/Allocator.h" | 34 #include "wtf/Allocator.h" |
35 #include "wtf/Noncopyable.h" | 35 #include "wtf/Noncopyable.h" |
36 | 36 |
37 #if ENABLE(WEB_AUDIO) | |
38 | |
39 namespace blink { | 37 namespace blink { |
40 | 38 |
41 // ReverbAccumulationBuffer is a circular delay buffer with one client reading f
rom it and multiple clients | 39 // ReverbAccumulationBuffer is a circular delay buffer with one client reading f
rom it and multiple clients |
42 // writing/accumulating to it at different delay offsets from the read position.
The read operation will zero the memory | 40 // writing/accumulating to it at different delay offsets from the read position.
The read operation will zero the memory |
43 // just read from the buffer, so it will be ready for accumulation the next time
around. | 41 // just read from the buffer, so it will be ready for accumulation the next time
around. |
44 class PLATFORM_EXPORT ReverbAccumulationBuffer { | 42 class PLATFORM_EXPORT ReverbAccumulationBuffer { |
45 DISALLOW_NEW(); | 43 DISALLOW_NEW(); |
46 WTF_MAKE_NONCOPYABLE(ReverbAccumulationBuffer); | 44 WTF_MAKE_NONCOPYABLE(ReverbAccumulationBuffer); |
47 public: | 45 public: |
48 ReverbAccumulationBuffer(size_t length); | 46 ReverbAccumulationBuffer(size_t length); |
(...skipping 15 matching lines...) Expand all Loading... |
64 void reset(); | 62 void reset(); |
65 | 63 |
66 private: | 64 private: |
67 AudioFloatArray m_buffer; | 65 AudioFloatArray m_buffer; |
68 size_t m_readIndex; | 66 size_t m_readIndex; |
69 size_t m_readTimeFrame; // for debugging (frame on continuous timeline) | 67 size_t m_readTimeFrame; // for debugging (frame on continuous timeline) |
70 }; | 68 }; |
71 | 69 |
72 } // namespace blink | 70 } // namespace blink |
73 | 71 |
74 #endif // ENABLE(WEB_AUDIO) | |
75 | |
76 #endif // ReverbAccumulationBuffer_h | 72 #endif // ReverbAccumulationBuffer_h |
OLD | NEW |