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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "base/gtest_prod_util.h" | 28 #include "base/gtest_prod_util.h" |
29 #include "modules/ModulesExport.h" | 29 #include "modules/ModulesExport.h" |
30 #include "modules/webaudio/AudioNode.h" | 30 #include "modules/webaudio/AudioNode.h" |
31 #include "wtf/RefPtr.h" | 31 #include "wtf/RefPtr.h" |
32 #include "wtf/ThreadingPrimitives.h" | 32 #include "wtf/ThreadingPrimitives.h" |
33 #include <memory> | 33 #include <memory> |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 class AudioBuffer; | 37 class AudioBuffer; |
| 38 class ConvolverOptions; |
38 class ExceptionState; | 39 class ExceptionState; |
39 class Reverb; | 40 class Reverb; |
40 | 41 |
41 class MODULES_EXPORT ConvolverHandler final : public AudioHandler { | 42 class MODULES_EXPORT ConvolverHandler final : public AudioHandler { |
42 public: | 43 public: |
43 static PassRefPtr<ConvolverHandler> create(AudioNode&, float sampleRate); | 44 static PassRefPtr<ConvolverHandler> create(AudioNode&, float sampleRate); |
44 ~ConvolverHandler() override; | 45 ~ConvolverHandler() override; |
45 | 46 |
46 // AudioHandler | 47 // AudioHandler |
47 void process(size_t framesToProcess) override; | 48 void process(size_t framesToProcess) override; |
(...skipping 21 matching lines...) Expand all Loading... |
69 // Normalize the impulse response or not. Must default to true. | 70 // Normalize the impulse response or not. Must default to true. |
70 bool m_normalize; | 71 bool m_normalize; |
71 | 72 |
72 FRIEND_TEST_ALL_PREFIXES(ConvolverNodeTest, ReverbLifetime); | 73 FRIEND_TEST_ALL_PREFIXES(ConvolverNodeTest, ReverbLifetime); |
73 }; | 74 }; |
74 | 75 |
75 class MODULES_EXPORT ConvolverNode final : public AudioNode { | 76 class MODULES_EXPORT ConvolverNode final : public AudioNode { |
76 DEFINE_WRAPPERTYPEINFO(); | 77 DEFINE_WRAPPERTYPEINFO(); |
77 public: | 78 public: |
78 static ConvolverNode* create(BaseAudioContext&, ExceptionState&); | 79 static ConvolverNode* create(BaseAudioContext&, ExceptionState&); |
| 80 static ConvolverNode* create(BaseAudioContext*, const ConvolverOptions&, Exc
eptionState&); |
79 | 81 |
80 AudioBuffer* buffer() const; | 82 AudioBuffer* buffer() const; |
81 void setBuffer(AudioBuffer*, ExceptionState&); | 83 void setBuffer(AudioBuffer*, ExceptionState&); |
82 bool normalize() const; | 84 bool normalize() const; |
83 void setNormalize(bool); | 85 void setNormalize(bool); |
84 | 86 |
85 private: | 87 private: |
86 ConvolverNode(BaseAudioContext&); | 88 ConvolverNode(BaseAudioContext&); |
87 ConvolverHandler& convolverHandler() const; | 89 ConvolverHandler& convolverHandler() const; |
88 | 90 |
89 FRIEND_TEST_ALL_PREFIXES(ConvolverNodeTest, ReverbLifetime); | 91 FRIEND_TEST_ALL_PREFIXES(ConvolverNodeTest, ReverbLifetime); |
90 }; | 92 }; |
91 | 93 |
92 } // namespace blink | 94 } // namespace blink |
93 | 95 |
94 #endif // ConvolverNode_h | 96 #endif // ConvolverNode_h |
OLD | NEW |