Index: Source/platform/audio/StereoPanner.h |
diff --git a/Source/platform/audio/StereoPanner.h b/Source/platform/audio/StereoPanner.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9d9b7f826a785d018d6dc6c8da8f394998d0752a |
--- /dev/null |
+++ b/Source/platform/audio/StereoPanner.h |
@@ -0,0 +1,35 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef StereoPanner_h |
+#define StereoPanner_h |
+ |
+#include "platform/audio/Spatializer.h" |
+ |
+namespace blink { |
+ |
+// Common type of stereo panner as found in normal audio mixing equipment. |
+class PLATFORM_EXPORT StereoPanner final : public Spatializer { |
+public: |
+ explicit StereoPanner(float sampleRate); |
+ |
+ virtual void panWithSampleAccurateValues(const AudioBus* inputBus, AudioBus* outputBuf, const float* panValues, size_t framesToProcess) override; |
+ virtual void panToTargetValue(const AudioBus* inputBus, AudioBus* outputBuf, float panValue, size_t framesToProcess) override; |
+ |
+ virtual void reset() override { } |
+ |
+ virtual double tailTime() const override { return 0; } |
+ virtual double latencyTime() const override { return 0; } |
+ |
+private: |
+ bool m_isFirstRender; |
+ double m_smoothingConstant; |
+ |
+ double m_gainL; |
+ double m_gainR; |
+}; |
+ |
+} // namespace blink |
+ |
+#endif // StereoPanner_h |