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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 outputBus->zero(); | 56 outputBus->zero(); |
57 return; | 57 return; |
58 } | 58 } |
59 | 59 |
60 if (m_pan->hasSampleAccurateValues()) { | 60 if (m_pan->hasSampleAccurateValues()) { |
61 // Apply sample-accurate panning specified by AudioParam automation. | 61 // Apply sample-accurate panning specified by AudioParam automation. |
62 DCHECK_LE(framesToProcess, m_sampleAccuratePanValues.size()); | 62 DCHECK_LE(framesToProcess, m_sampleAccuratePanValues.size()); |
63 if (framesToProcess <= m_sampleAccuratePanValues.size()) { | 63 if (framesToProcess <= m_sampleAccuratePanValues.size()) { |
64 float* panValues = m_sampleAccuratePanValues.data(); | 64 float* panValues = m_sampleAccuratePanValues.data(); |
65 m_pan->calculateSampleAccurateValues(panValues, framesToProcess); | 65 m_pan->calculateSampleAccurateValues(panValues, framesToProcess); |
66 m_stereoPanner->panWithSampleAccurateValues(inputBus, outputBus, pan Values, framesToProcess); | 66 m_stereoPanner->panWithSampleAccurateValues( |
Raymond Toy
2016/08/24 18:30:29
It looks like nothing changed here other than inde
hongchan
2016/08/24 21:52:33
Done.
| |
67 inputBus, outputBus, panValues, framesToProcess); | |
67 } | 68 } |
68 } else { | 69 } else { |
69 m_stereoPanner->panToTargetValue(inputBus, outputBus, m_pan->value(), fr amesToProcess); | 70 m_stereoPanner->panToTargetValue( |
71 inputBus, outputBus, m_pan->value(), framesToProcess); | |
Raymond Toy
2016/08/24 18:30:29
Please revert this indentation change.
hongchan
2016/08/24 21:52:33
Done.
| |
70 } | 72 } |
71 } | 73 } |
72 | 74 |
73 void StereoPannerHandler::initialize() | 75 void StereoPannerHandler::initialize() |
74 { | 76 { |
75 if (isInitialized()) | 77 if (isInitialized()) |
76 return; | 78 return; |
77 | 79 |
78 m_stereoPanner = Spatializer::create(Spatializer::PanningModelEqualPower, sa mpleRate()); | 80 m_stereoPanner = StereoPanner::create(sampleRate()); |
79 | 81 |
80 AudioHandler::initialize(); | 82 AudioHandler::initialize(); |
81 } | 83 } |
82 | 84 |
83 void StereoPannerHandler::setChannelCount(unsigned long channelCount, ExceptionS tate& exceptionState) | 85 void StereoPannerHandler::setChannelCount(unsigned long channelCount, ExceptionS tate& exceptionState) |
84 { | 86 { |
85 DCHECK(isMainThread()); | 87 DCHECK(isMainThread()); |
86 BaseAudioContext::AutoLocker locker(context()); | 88 BaseAudioContext::AutoLocker locker(context()); |
87 | 89 |
88 // A PannerNode only supports 1 or 2 channels | 90 // A PannerNode only supports 1 or 2 channels |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
150 AudioNode::trace(visitor); | 152 AudioNode::trace(visitor); |
151 } | 153 } |
152 | 154 |
153 AudioParam* StereoPannerNode::pan() const | 155 AudioParam* StereoPannerNode::pan() const |
154 { | 156 { |
155 return m_pan; | 157 return m_pan; |
156 } | 158 } |
157 | 159 |
158 } // namespace blink | 160 } // namespace blink |
159 | 161 |
OLD | NEW |