Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1053)

Unified Diff: third_party/WebKit/Source/platform/audio/StereoPanner.h

Issue 2272683003: Remove redundant definition of Spatializer abstract class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Detach StereoPanner from Panner base class (plus rebasing) Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/audio/StereoPanner.h
diff --git a/third_party/WebKit/Source/platform/audio/StereoPanner.h b/third_party/WebKit/Source/platform/audio/StereoPanner.h
index 14b9caefe28b8d7bcf927705835781f8bf73f119..a892fe2f7f51bfb11a9d03e4f2d560e1b307477b 100644
--- a/third_party/WebKit/Source/platform/audio/StereoPanner.h
+++ b/third_party/WebKit/Source/platform/audio/StereoPanner.h
@@ -5,26 +5,32 @@
#ifndef StereoPanner_h
#define StereoPanner_h
-#include "platform/audio/Spatializer.h"
+#include "platform/PlatformExport.h"
+#include "wtf/Allocator.h"
+#include "wtf/Noncopyable.h"
+#include <memory>
Raymond Toy 2016/08/24 18:30:29 Is including memory needed here? Is it for USING_
hongchan 2016/08/24 21:52:33 Done.
namespace blink {
-// Common type of stereo panner as found in normal audio mixing equipment.
-// See: http://webaudio.github.io/web-audio-api/#the-stereopannernode-interface
+class AudioBus;
-class PLATFORM_EXPORT StereoPanner final : public Spatializer {
-public:
- explicit StereoPanner(float sampleRate);
+// Implement the equal-power panning algorithm for mono or stereo input. See:
+// http://webaudio.github.io/web-audio-api/#panning-algorithm
- void panWithSampleAccurateValues(const AudioBus* inputBus, AudioBus* outputBuf, const float* panValues, size_t framesToProcess) override;
- void panToTargetValue(const AudioBus* inputBus, AudioBus* outputBuf, float panValue, size_t framesToProcess) override;
+class PLATFORM_EXPORT StereoPanner {
+ USING_FAST_MALLOC(StereoPanner);
+ WTF_MAKE_NONCOPYABLE(StereoPanner);
- void reset() override { }
+public:
+ static std::unique_ptr<StereoPanner> create(float sampleRate);
+ ~StereoPanner() { };
- double tailTime() const override { return 0; }
- double latencyTime() const override { return 0; }
+ void panWithSampleAccurateValues(const AudioBus* inputBus, AudioBus* outputBus, const float* panValues, size_t framesToProcess);
+ void panToTargetValue(const AudioBus* inputBus, AudioBus* outputBus, float panValue, size_t framesToProcess);
private:
+ explicit StereoPanner(float sampleRate);
+
bool m_isFirstRender;
double m_smoothingConstant;

Powered by Google App Engine
This is Rietveld 408576698