| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef StereoPannerNode_h | 5 #ifndef StereoPannerNode_h |
| 6 #define StereoPannerNode_h | 6 #define StereoPannerNode_h |
| 7 | 7 |
| 8 #include "modules/webaudio/AudioNode.h" | 8 #include "modules/webaudio/AudioNode.h" |
| 9 #include "modules/webaudio/AudioParam.h" | 9 #include "modules/webaudio/AudioParam.h" |
| 10 #include "platform/audio/AudioBus.h" | 10 #include "platform/audio/AudioBus.h" |
| 11 #include "platform/audio/Spatializer.h" | 11 #include "platform/audio/Spatializer.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 // StereoPannerNode is an AudioNode with one input and one output. It is | 15 // StereoPannerNode is an AudioNode with one input and one output. It is |
| 16 // specifically designed for equal-power stereo panning. | 16 // specifically designed for equal-power stereo panning. |
| 17 class StereoPannerHandler final : public AudioHandler { | 17 class StereoPannerHandler final : public AudioHandler { |
| 18 public: | 18 public: |
| 19 static PassRefPtr<StereoPannerHandler> create(AudioNode&, float sampleRate,
AudioParamHandler& pan); | 19 static PassRefPtr<StereoPannerHandler> create(AudioNode&, float sampleRate,
AudioParamHandler& pan); |
| 20 virtual ~StereoPannerHandler(); | 20 ~StereoPannerHandler() override; |
| 21 | 21 |
| 22 virtual void process(size_t framesToProcess) override; | 22 void process(size_t framesToProcess) override; |
| 23 virtual void initialize() override; | 23 void initialize() override; |
| 24 | 24 |
| 25 virtual void setChannelCount(unsigned long, ExceptionState&) final; | 25 void setChannelCount(unsigned long, ExceptionState&) final; |
| 26 virtual void setChannelCountMode(const String&, ExceptionState&) final; | 26 void setChannelCountMode(const String&, ExceptionState&) final; |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 StereoPannerHandler(AudioNode&, float sampleRate, AudioParamHandler& pan); | 29 StereoPannerHandler(AudioNode&, float sampleRate, AudioParamHandler& pan); |
| 30 | 30 |
| 31 OwnPtr<Spatializer> m_stereoPanner; | 31 OwnPtr<Spatializer> m_stereoPanner; |
| 32 RefPtr<AudioParamHandler> m_pan; | 32 RefPtr<AudioParamHandler> m_pan; |
| 33 | 33 |
| 34 AudioFloatArray m_sampleAccuratePanValues; | 34 AudioFloatArray m_sampleAccuratePanValues; |
| 35 | 35 |
| 36 // TODO(tkent): Use FRIEND_TEST macro provided by gtest_prod.h | 36 // TODO(tkent): Use FRIEND_TEST macro provided by gtest_prod.h |
| (...skipping 10 matching lines...) Expand all Loading... |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 StereoPannerNode(AudioContext&, float sampleRate); | 49 StereoPannerNode(AudioContext&, float sampleRate); |
| 50 | 50 |
| 51 Member<AudioParam> m_pan; | 51 Member<AudioParam> m_pan; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace blink | 54 } // namespace blink |
| 55 | 55 |
| 56 #endif // StereoPannerNode_h | 56 #endif // StereoPannerNode_h |
| OLD | NEW |