| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 class AudioBuffer; | 36 class AudioBuffer; |
| 37 class ExceptionState; | 37 class ExceptionState; |
| 38 class Reverb; | 38 class Reverb; |
| 39 | 39 |
| 40 class MODULES_EXPORT ConvolverHandler final : public AudioHandler { | 40 class MODULES_EXPORT ConvolverHandler final : public AudioHandler { |
| 41 public: | 41 public: |
| 42 static PassRefPtr<ConvolverHandler> create(AudioNode&, float sampleRate); | 42 static PassRefPtr<ConvolverHandler> create(AudioNode&, float sampleRate); |
| 43 virtual ~ConvolverHandler(); | 43 ~ConvolverHandler() override; |
| 44 | 44 |
| 45 // AudioHandler | 45 // AudioHandler |
| 46 virtual void process(size_t framesToProcess) override; | 46 void process(size_t framesToProcess) override; |
| 47 | 47 |
| 48 // Impulse responses | 48 // Impulse responses |
| 49 void setBuffer(AudioBuffer*, ExceptionState&); | 49 void setBuffer(AudioBuffer*, ExceptionState&); |
| 50 AudioBuffer* buffer(); | 50 AudioBuffer* buffer(); |
| 51 | 51 |
| 52 bool normalize() const { return m_normalize; } | 52 bool normalize() const { return m_normalize; } |
| 53 void setNormalize(bool normalize) { m_normalize = normalize; } | 53 void setNormalize(bool normalize) { m_normalize = normalize; } |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 ConvolverHandler(AudioNode&, float sampleRate); | 56 ConvolverHandler(AudioNode&, float sampleRate); |
| 57 virtual double tailTime() const override; | 57 double tailTime() const override; |
| 58 virtual double latencyTime() const override; | 58 double latencyTime() const override; |
| 59 | 59 |
| 60 OwnPtr<Reverb> m_reverb; | 60 OwnPtr<Reverb> m_reverb; |
| 61 // This Persistent doesn't make a reference cycle including the owner | 61 // This Persistent doesn't make a reference cycle including the owner |
| 62 // ConvolverNode. | 62 // ConvolverNode. |
| 63 Persistent<AudioBuffer> m_buffer; | 63 Persistent<AudioBuffer> m_buffer; |
| 64 | 64 |
| 65 // This synchronizes dynamic changes to the convolution impulse response wit
h process(). | 65 // This synchronizes dynamic changes to the convolution impulse response wit
h process(). |
| 66 mutable Mutex m_processLock; | 66 mutable Mutex m_processLock; |
| 67 | 67 |
| 68 // Normalize the impulse response or not. Must default to true. | 68 // Normalize the impulse response or not. Must default to true. |
| (...skipping 17 matching lines...) Expand all Loading... |
| 86 ConvolverNode(AudioContext&, float sampleRate); | 86 ConvolverNode(AudioContext&, float sampleRate); |
| 87 ConvolverHandler& convolverHandler() const; | 87 ConvolverHandler& convolverHandler() const; |
| 88 | 88 |
| 89 // TODO(tkent): Use FRIEND_TEST macro provided by gtest_prod.h | 89 // TODO(tkent): Use FRIEND_TEST macro provided by gtest_prod.h |
| 90 friend class ConvolverNodeTest_ReverbLifetime_Test; | 90 friend class ConvolverNodeTest_ReverbLifetime_Test; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace blink | 93 } // namespace blink |
| 94 | 94 |
| 95 #endif // ConvolverNode_h | 95 #endif // ConvolverNode_h |
| OLD | NEW |