| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 } else { | 71 } else { |
| 72 m_stereoPanner->panToTargetValue(inputBus, outputBus, m_pan->value(), | 72 m_stereoPanner->panToTargetValue(inputBus, outputBus, m_pan->value(), |
| 73 framesToProcess); | 73 framesToProcess); |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 | 76 |
| 77 void StereoPannerHandler::initialize() { | 77 void StereoPannerHandler::initialize() { |
| 78 if (isInitialized()) | 78 if (isInitialized()) |
| 79 return; | 79 return; |
| 80 | 80 |
| 81 m_stereoPanner = StereoPanner::create(sampleRate()); | 81 m_stereoPanner = StereoPanner::create(context()->sampleRate()); |
| 82 | 82 |
| 83 AudioHandler::initialize(); | 83 AudioHandler::initialize(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void StereoPannerHandler::setChannelCount(unsigned long channelCount, | 86 void StereoPannerHandler::setChannelCount(unsigned long channelCount, |
| 87 ExceptionState& exceptionState) { | 87 ExceptionState& exceptionState) { |
| 88 DCHECK(isMainThread()); | 88 DCHECK(isMainThread()); |
| 89 BaseAudioContext::AutoLocker locker(context()); | 89 BaseAudioContext::AutoLocker locker(context()); |
| 90 | 90 |
| 91 // A PannerNode only supports 1 or 2 channels | 91 // A PannerNode only supports 1 or 2 channels |
| (...skipping 78 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 |