| 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 "config.h" | 5 #include "config.h" |
| 6 #if ENABLE(WEB_AUDIO) | 6 #if ENABLE(WEB_AUDIO) |
| 7 #include "modules/webaudio/StereoPannerNode.h" | 7 #include "modules/webaudio/StereoPannerNode.h" |
| 8 | 8 |
| 9 #include "bindings/core/v8/ExceptionMessages.h" | 9 #include "bindings/core/v8/ExceptionMessages.h" |
| 10 #include "bindings/core/v8/ExceptionState.h" | 10 #include "bindings/core/v8/ExceptionState.h" |
| 11 #include "core/dom/ExceptionCode.h" | 11 #include "core/dom/ExceptionCode.h" |
| 12 #include "core/dom/ExecutionContext.h" | 12 #include "core/dom/ExecutionContext.h" |
| 13 #include "modules/webaudio/AudioContext.h" | 13 #include "modules/webaudio/AudioContext.h" |
| 14 #include "modules/webaudio/AudioNodeInput.h" | 14 #include "modules/webaudio/AudioNodeInput.h" |
| 15 #include "modules/webaudio/AudioNodeOutput.h" | 15 #include "modules/webaudio/AudioNodeOutput.h" |
| 16 #include "platform/audio/StereoPanner.h" | 16 #include "platform/audio/StereoPanner.h" |
| 17 #include "wtf/MathExtras.h" | 17 #include "wtf/MathExtras.h" |
| 18 | 18 |
| 19 namespace blink { | 19 namespace blink { |
| 20 | 20 |
| 21 StereoPannerNode::StereoPannerNode(AudioContext* context, float sampleRate) | 21 StereoPannerNode::StereoPannerNode(AudioContext* context, float sampleRate) |
| 22 : AudioNode(NodeTypeStereoPanner, context, sampleRate) | 22 : AudioNode(NodeTypeStereoPanner, context, sampleRate) |
| 23 , m_sampleAccuratePanValues(AudioNode::ProcessingSizeInFrames) | 23 , m_sampleAccuratePanValues(AudioNode::ProcessingSizeInFrames) |
| 24 { | 24 { |
| 25 m_pan = AudioParam::create(context, 0); | 25 m_pan = AudioParam::create(context, 0); |
| 26 | 26 |
| 27 addInput(); | 27 addInput(); |
| 28 addOutput(AudioNodeOutput::create(this, 2)); | 28 addOutput(2); |
| 29 | 29 |
| 30 // The node-specific default mixing rules declare that StereoPannerNode | 30 // The node-specific default mixing rules declare that StereoPannerNode |
| 31 // can handle mono to stereo and stereo to stereo conversion. | 31 // can handle mono to stereo and stereo to stereo conversion. |
| 32 m_channelCount = 2; | 32 m_channelCount = 2; |
| 33 m_channelCountMode = ClampedMax; | 33 m_channelCountMode = ClampedMax; |
| 34 m_channelInterpretation = AudioBus::Speakers; | 34 m_channelInterpretation = AudioBus::Speakers; |
| 35 | 35 |
| 36 initialize(); | 36 initialize(); |
| 37 } | 37 } |
| 38 | 38 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 DEFINE_TRACE(StereoPannerNode) | 153 DEFINE_TRACE(StereoPannerNode) |
| 154 { | 154 { |
| 155 visitor->trace(m_stereoPanner); | 155 visitor->trace(m_stereoPanner); |
| 156 visitor->trace(m_pan); | 156 visitor->trace(m_pan); |
| 157 AudioNode::trace(visitor); | 157 AudioNode::trace(visitor); |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace blink | 160 } // namespace blink |
| 161 | 161 |
| 162 #endif // ENABLE(WEB_AUDIO) | 162 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |