| 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" |
| 11 #include "modules/webaudio/AudioNodeOutput.h" | 11 #include "modules/webaudio/AudioNodeOutput.h" |
| 12 #include "modules/webaudio/BaseAudioContext.h" | 12 #include "modules/webaudio/BaseAudioContext.h" |
| 13 #include "modules/webaudio/StereoPannerOptions.h" | 13 #include "modules/webaudio/StereoPannerOptions.h" |
| 14 #include "platform/audio/StereoPanner.h" | 14 #include "platform/audio/StereoPanner.h" |
| 15 #include "wtf/MathExtras.h" | 15 #include "wtf/MathExtras.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 StereoPannerHandler::StereoPannerHandler(AudioNode& node, | 19 StereoPannerHandler::StereoPannerHandler(AudioNode& node, |
| 20 float sampleRate, | 20 float sampleRate, |
| 21 AudioParamHandler& pan) | 21 AudioParamHandler& pan) |
| 22 : AudioHandler(NodeTypeStereoPanner, node, sampleRate), | 22 : AudioHandler(NodeTypeStereoPanner, node, sampleRate), |
| 23 m_pan(pan), | 23 m_pan(pan), |
| 24 m_sampleAccuratePanValues(ProcessingSizeInFrames) { | 24 m_sampleAccuratePanValues(AudioUtilities::kRenderQuantumFrames) { |
| 25 addInput(); | 25 addInput(); |
| 26 addOutput(2); | 26 addOutput(2); |
| 27 | 27 |
| 28 // The node-specific default mixing rules declare that StereoPannerNode | 28 // The node-specific default mixing rules declare that StereoPannerNode |
| 29 // can handle mono to stereo and stereo to stereo conversion. | 29 // can handle mono to stereo and stereo to stereo conversion. |
| 30 m_channelCount = 2; | 30 m_channelCount = 2; |
| 31 setInternalChannelCountMode(ClampedMax); | 31 setInternalChannelCountMode(ClampedMax); |
| 32 setInternalChannelInterpretation(AudioBus::Speakers); | 32 setInternalChannelInterpretation(AudioBus::Speakers); |
| 33 | 33 |
| 34 initialize(); | 34 initialize(); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 DEFINE_TRACE(StereoPannerNode) { | 170 DEFINE_TRACE(StereoPannerNode) { |
| 171 visitor->trace(m_pan); | 171 visitor->trace(m_pan); |
| 172 AudioNode::trace(visitor); | 172 AudioNode::trace(visitor); |
| 173 } | 173 } |
| 174 | 174 |
| 175 AudioParam* StereoPannerNode::pan() const { | 175 AudioParam* StereoPannerNode::pan() const { |
| 176 return m_pan; | 176 return m_pan; |
| 177 } | 177 } |
| 178 | 178 |
| 179 } // namespace blink | 179 } // namespace blink |
| OLD | NEW |