| 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 29 matching lines...) Expand all Loading... |
| 40 class ExceptionState; | 40 class ExceptionState; |
| 41 class Reverb; | 41 class Reverb; |
| 42 | 42 |
| 43 class MODULES_EXPORT ConvolverHandler final : public AudioHandler { | 43 class MODULES_EXPORT ConvolverHandler final : public AudioHandler { |
| 44 public: | 44 public: |
| 45 static PassRefPtr<ConvolverHandler> create(AudioNode&, float sampleRate); | 45 static PassRefPtr<ConvolverHandler> create(AudioNode&, float sampleRate); |
| 46 ~ConvolverHandler() override; | 46 ~ConvolverHandler() override; |
| 47 | 47 |
| 48 // AudioHandler | 48 // AudioHandler |
| 49 void process(size_t framesToProcess) override; | 49 void process(size_t framesToProcess) override; |
| 50 // Called in the main thread when the number of channels for the input may |
| 51 // have changed. |
| 52 void checkNumberOfChannelsForInput(AudioNodeInput*) override; |
| 50 | 53 |
| 51 // Impulse responses | 54 // Impulse responses |
| 52 void setBuffer(AudioBuffer*, ExceptionState&); | 55 void setBuffer(AudioBuffer*, ExceptionState&); |
| 53 AudioBuffer* buffer(); | 56 AudioBuffer* buffer(); |
| 54 | 57 |
| 55 bool normalize() const { return m_normalize; } | 58 bool normalize() const { return m_normalize; } |
| 56 void setNormalize(bool normalize) { m_normalize = normalize; } | 59 void setNormalize(bool normalize) { m_normalize = normalize; } |
| 60 void setChannelCount(unsigned long, ExceptionState&) final; |
| 61 void setChannelCountMode(const String&, ExceptionState&) final; |
| 57 | 62 |
| 58 private: | 63 private: |
| 59 ConvolverHandler(AudioNode&, float sampleRate); | 64 ConvolverHandler(AudioNode&, float sampleRate); |
| 60 double tailTime() const override; | 65 double tailTime() const override; |
| 61 double latencyTime() const override; | 66 double latencyTime() const override; |
| 62 | 67 |
| 63 std::unique_ptr<Reverb> m_reverb; | 68 std::unique_ptr<Reverb> m_reverb; |
| 64 // This Persistent doesn't make a reference cycle including the owner | 69 // This Persistent doesn't make a reference cycle including the owner |
| 65 // ConvolverNode. | 70 // ConvolverNode. |
| 66 // It is cross-thread, as it will be accessed by the audio and main threads. | 71 // It is cross-thread, as it will be accessed by the audio and main threads. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 93 private: | 98 private: |
| 94 ConvolverNode(BaseAudioContext&); | 99 ConvolverNode(BaseAudioContext&); |
| 95 ConvolverHandler& convolverHandler() const; | 100 ConvolverHandler& convolverHandler() const; |
| 96 | 101 |
| 97 FRIEND_TEST_ALL_PREFIXES(ConvolverNodeTest, ReverbLifetime); | 102 FRIEND_TEST_ALL_PREFIXES(ConvolverNodeTest, ReverbLifetime); |
| 98 }; | 103 }; |
| 99 | 104 |
| 100 } // namespace blink | 105 } // namespace blink |
| 101 | 106 |
| 102 #endif // ConvolverNode_h | 107 #endif // ConvolverNode_h |
| OLD | NEW |