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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/modules/webaudio/AudioNode.cpp ('k') | Source/modules/webaudio/StereoPannerNode.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef StereoPannerNode_h
6 #define StereoPannerNode_h
7
8 #include "modules/webaudio/AudioNode.h"
9 #include "modules/webaudio/AudioParam.h"
10 #include "platform/audio/AudioBus.h"
11 #include "platform/audio/Spatializer.h"
12
13 namespace blink {
14
15 // StereoPannerNode is an AudioNode with one input and one output. It is
16 // specifically designed for equal-power stereo panning.
17 class StereoPannerNode final : public AudioNode {
18 DEFINE_WRAPPERTYPEINFO();
19 public:
20 static StereoPannerNode* create(AudioContext* context, float sampleRate)
21 {
22 return new StereoPannerNode(context, sampleRate);
23 }
24
25 virtual ~StereoPannerNode();
26
27 virtual void dispose() override;
28 virtual void process(size_t framesToProcess) override;
29 virtual void initialize() override;
30 virtual void uninitialize() override;
31
32 virtual double tailTime() const override { return 0; }
33 virtual double latencyTime() const override { return 0; }
34
35 virtual void setChannelCount(unsigned long, ExceptionState&) final;
36 virtual void setChannelCountMode(const String&, ExceptionState&) final;
37
38 virtual void trace(Visitor*) override;
39
40 AudioParam* pan() { return m_pan.get(); }
41
42 private:
43 StereoPannerNode(AudioContext*, float sampleRate);
44
45 Member<Spatializer> m_stereoPanner;
46 Member<AudioParam> m_pan;
47
48 AudioFloatArray m_sampleAccuratePanValues;
49 };
50
51 } // namespace blink
52
53 #endif // StereoPannerNode_h
OLDNEW
« 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