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

Unified Diff: Source/modules/webaudio/StereoPannerNode.h

Issue 691143007: Implement StereoPannerNode for robust stereo panning (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « Source/modules/webaudio/AudioNode.cpp ('k') | Source/modules/webaudio/StereoPannerNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/StereoPannerNode.h
diff --git a/Source/modules/webaudio/StereoPannerNode.h b/Source/modules/webaudio/StereoPannerNode.h
new file mode 100644
index 0000000000000000000000000000000000000000..e0bfec9b977acdcaee8058d866466ecfc204b9a9
--- /dev/null
+++ b/Source/modules/webaudio/StereoPannerNode.h
@@ -0,0 +1,53 @@
+// 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 StereoPannerNode_h
+#define StereoPannerNode_h
+
+#include "modules/webaudio/AudioNode.h"
+#include "modules/webaudio/AudioParam.h"
+#include "platform/audio/AudioBus.h"
+#include "platform/audio/Spatializer.h"
+
+namespace blink {
+
+// StereoPannerNode is an AudioNode with one input and one output. It is
+// specifically designed for equal-power stereo panning.
+class StereoPannerNode final : public AudioNode {
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ static StereoPannerNode* create(AudioContext* context, float sampleRate)
+ {
+ return new StereoPannerNode(context, sampleRate);
+ }
+
+ virtual ~StereoPannerNode();
+
+ virtual void dispose() override;
+ virtual void process(size_t framesToProcess) override;
+ virtual void initialize() override;
+ virtual void uninitialize() override;
+
+ virtual double tailTime() const override { return 0; }
+ virtual double latencyTime() const override { return 0; }
+
+ virtual void setChannelCount(unsigned long, ExceptionState&) final;
+ virtual void setChannelCountMode(const String&, ExceptionState&) final;
+
+ virtual void trace(Visitor*) override;
+
+ AudioParam* pan() { return m_pan.get(); }
+
+private:
+ StereoPannerNode(AudioContext*, float sampleRate);
+
+ Member<Spatializer> m_stereoPanner;
+ Member<AudioParam> m_pan;
+
+ AudioFloatArray m_sampleAccuratePanValues;
+};
+
+} // namespace blink
+
+#endif // StereoPannerNode_h
« no previous file with comments | « Source/modules/webaudio/AudioNode.cpp ('k') | Source/modules/webaudio/StereoPannerNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698