| 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 StereoPanner_h | 5 #ifndef StereoPanner_h |
| 6 #define StereoPanner_h | 6 #define StereoPanner_h |
| 7 | 7 |
| 8 #include "platform/audio/Spatializer.h" | 8 #include "platform/audio/Spatializer.h" |
| 9 | 9 |
| 10 #if ENABLE(WEB_AUDIO) | |
| 11 | |
| 12 namespace blink { | 10 namespace blink { |
| 13 | 11 |
| 14 // Common type of stereo panner as found in normal audio mixing equipment. | 12 // Common type of stereo panner as found in normal audio mixing equipment. |
| 15 // See: http://webaudio.github.io/web-audio-api/#the-stereopannernode-interface | 13 // See: http://webaudio.github.io/web-audio-api/#the-stereopannernode-interface |
| 16 | 14 |
| 17 class PLATFORM_EXPORT StereoPanner final : public Spatializer { | 15 class PLATFORM_EXPORT StereoPanner final : public Spatializer { |
| 18 public: | 16 public: |
| 19 explicit StereoPanner(float sampleRate); | 17 explicit StereoPanner(float sampleRate); |
| 20 | 18 |
| 21 void panWithSampleAccurateValues(const AudioBus* inputBus, AudioBus* outputB
uf, const float* panValues, size_t framesToProcess) override; | 19 void panWithSampleAccurateValues(const AudioBus* inputBus, AudioBus* outputB
uf, const float* panValues, size_t framesToProcess) override; |
| 22 void panToTargetValue(const AudioBus* inputBus, AudioBus* outputBuf, float p
anValue, size_t framesToProcess) override; | 20 void panToTargetValue(const AudioBus* inputBus, AudioBus* outputBuf, float p
anValue, size_t framesToProcess) override; |
| 23 | 21 |
| 24 void reset() override { } | 22 void reset() override { } |
| 25 | 23 |
| 26 double tailTime() const override { return 0; } | 24 double tailTime() const override { return 0; } |
| 27 double latencyTime() const override { return 0; } | 25 double latencyTime() const override { return 0; } |
| 28 | 26 |
| 29 private: | 27 private: |
| 30 bool m_isFirstRender; | 28 bool m_isFirstRender; |
| 31 double m_smoothingConstant; | 29 double m_smoothingConstant; |
| 32 | 30 |
| 33 double m_pan; | 31 double m_pan; |
| 34 }; | 32 }; |
| 35 | 33 |
| 36 } // namespace blink | 34 } // namespace blink |
| 37 | 35 |
| 38 #endif // ENABLE(WEB_AUDIO) | |
| 39 | |
| 40 #endif // StereoPanner_h | 36 #endif // StereoPanner_h |
| OLD | NEW |