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 #include "modules/webaudio/StereoPannerNode.h" | 5 #include "modules/webaudio/StereoPannerNode.h" |
6 #include "bindings/core/v8/ExceptionMessages.h" | 6 #include "bindings/core/v8/ExceptionMessages.h" |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "core/dom/ExceptionCode.h" | 8 #include "core/dom/ExceptionCode.h" |
9 #include "core/dom/ExecutionContext.h" | 9 #include "core/dom/ExecutionContext.h" |
10 #include "modules/webaudio/AudioNodeInput.h" | 10 #include "modules/webaudio/AudioNodeInput.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 float values[AudioUtilities::kRenderQuantumFrames]; | 78 float values[AudioUtilities::kRenderQuantumFrames]; |
79 DCHECK_LE(framesToProcess, AudioUtilities::kRenderQuantumFrames); | 79 DCHECK_LE(framesToProcess, AudioUtilities::kRenderQuantumFrames); |
80 | 80 |
81 m_pan->calculateSampleAccurateValues(values, framesToProcess); | 81 m_pan->calculateSampleAccurateValues(values, framesToProcess); |
82 } | 82 } |
83 | 83 |
84 void StereoPannerHandler::initialize() { | 84 void StereoPannerHandler::initialize() { |
85 if (isInitialized()) | 85 if (isInitialized()) |
86 return; | 86 return; |
87 | 87 |
88 m_stereoPanner = StereoPanner::create(sampleRate()); | 88 m_stereoPanner = StereoPanner::create(context()->sampleRate()); |
89 | 89 |
90 AudioHandler::initialize(); | 90 AudioHandler::initialize(); |
91 } | 91 } |
92 | 92 |
93 void StereoPannerHandler::setChannelCount(unsigned long channelCount, | 93 void StereoPannerHandler::setChannelCount(unsigned long channelCount, |
94 ExceptionState& exceptionState) { | 94 ExceptionState& exceptionState) { |
95 DCHECK(isMainThread()); | 95 DCHECK(isMainThread()); |
96 BaseAudioContext::AutoLocker locker(context()); | 96 BaseAudioContext::AutoLocker locker(context()); |
97 | 97 |
98 // A PannerNode only supports 1 or 2 channels | 98 // A PannerNode only supports 1 or 2 channels |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 DEFINE_TRACE(StereoPannerNode) { | 177 DEFINE_TRACE(StereoPannerNode) { |
178 visitor->trace(m_pan); | 178 visitor->trace(m_pan); |
179 AudioNode::trace(visitor); | 179 AudioNode::trace(visitor); |
180 } | 180 } |
181 | 181 |
182 AudioParam* StereoPannerNode::pan() const { | 182 AudioParam* StereoPannerNode::pan() const { |
183 return m_pan; | 183 return m_pan; |
184 } | 184 } |
185 | 185 |
186 } // namespace blink | 186 } // namespace blink |
OLD | NEW |