OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ConstantSourceNode.h" | 5 #include "modules/webaudio/ConstantSourceNode.h" |
6 | 6 |
| 7 #include <algorithm> |
7 #include "bindings/core/v8/ExceptionMessages.h" | 8 #include "bindings/core/v8/ExceptionMessages.h" |
8 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
9 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
10 #include "modules/webaudio/AudioNodeOutput.h" | 11 #include "modules/webaudio/AudioNodeOutput.h" |
11 #include "modules/webaudio/ConstantSourceOptions.h" | 12 #include "modules/webaudio/ConstantSourceOptions.h" |
12 #include "platform/audio/AudioUtilities.h" | 13 #include "platform/audio/AudioUtilities.h" |
13 #include "wtf/MathExtras.h" | 14 #include "wtf/MathExtras.h" |
14 #include "wtf/StdLibExtras.h" | 15 #include "wtf/StdLibExtras.h" |
15 #include <algorithm> | |
16 | 16 |
17 namespace blink { | 17 namespace blink { |
18 | 18 |
19 ConstantSourceHandler::ConstantSourceHandler(AudioNode& node, | 19 ConstantSourceHandler::ConstantSourceHandler(AudioNode& node, |
20 float sampleRate, | 20 float sampleRate, |
21 AudioParamHandler& offset) | 21 AudioParamHandler& offset) |
22 : AudioScheduledSourceHandler(NodeTypeConstantSource, node, sampleRate), | 22 : AudioScheduledSourceHandler(NodeTypeConstantSource, node, sampleRate), |
23 m_offset(offset), | 23 m_offset(offset), |
24 m_sampleAccurateValues(AudioUtilities::kRenderQuantumFrames) { | 24 m_sampleAccurateValues(AudioUtilities::kRenderQuantumFrames) { |
25 // A ConstantSource is always mono. | 25 // A ConstantSource is always mono. |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 ConstantSourceHandler& ConstantSourceNode::constantSourceHandler() const { | 148 ConstantSourceHandler& ConstantSourceNode::constantSourceHandler() const { |
149 return static_cast<ConstantSourceHandler&>(handler()); | 149 return static_cast<ConstantSourceHandler&>(handler()); |
150 } | 150 } |
151 | 151 |
152 AudioParam* ConstantSourceNode::offset() { | 152 AudioParam* ConstantSourceNode::offset() { |
153 return m_offset; | 153 return m_offset; |
154 } | 154 } |
155 | 155 |
156 } // namespace blink | 156 } // namespace blink |
OLD | NEW |