OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010, Google Inc. All rights reserved. | 2 * Copyright (C) 2010, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 ScriptProcessorNode::ScriptProcessorNode(AudioContext* context, float sampleRate
, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChan
nels) | 90 ScriptProcessorNode::ScriptProcessorNode(AudioContext* context, float sampleRate
, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChan
nels) |
91 : AudioNode(context, sampleRate) | 91 : AudioNode(context, sampleRate) |
92 , m_doubleBufferIndex(0) | 92 , m_doubleBufferIndex(0) |
93 , m_doubleBufferIndexForEvent(0) | 93 , m_doubleBufferIndexForEvent(0) |
94 , m_bufferSize(bufferSize) | 94 , m_bufferSize(bufferSize) |
95 , m_bufferReadWriteIndex(0) | 95 , m_bufferReadWriteIndex(0) |
96 , m_numberOfInputChannels(numberOfInputChannels) | 96 , m_numberOfInputChannels(numberOfInputChannels) |
97 , m_numberOfOutputChannels(numberOfOutputChannels) | 97 , m_numberOfOutputChannels(numberOfOutputChannels) |
98 , m_internalInputBus(AudioBus::create(numberOfInputChannels, AudioNode::Proc
essingSizeInFrames, false)) | 98 , m_internalInputBus(AudioBus::create(numberOfInputChannels, AudioNode::Proc
essingSizeInFrames, false)) |
99 { | 99 { |
100 ScriptWrappable::init(this); | |
101 // Regardless of the allowed buffer sizes, we still need to process at the g
ranularity of the AudioNode. | 100 // Regardless of the allowed buffer sizes, we still need to process at the g
ranularity of the AudioNode. |
102 if (m_bufferSize < AudioNode::ProcessingSizeInFrames) | 101 if (m_bufferSize < AudioNode::ProcessingSizeInFrames) |
103 m_bufferSize = AudioNode::ProcessingSizeInFrames; | 102 m_bufferSize = AudioNode::ProcessingSizeInFrames; |
104 | 103 |
105 ASSERT(numberOfInputChannels <= AudioContext::maxNumberOfChannels()); | 104 ASSERT(numberOfInputChannels <= AudioContext::maxNumberOfChannels()); |
106 | 105 |
107 addInput(); | 106 addInput(); |
108 addOutput(AudioNodeOutput::create(this, numberOfOutputChannels)); | 107 addOutput(AudioNodeOutput::create(this, numberOfOutputChannels)); |
109 | 108 |
110 setNodeType(NodeTypeJavaScript); | 109 setNodeType(NodeTypeJavaScript); |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 void ScriptProcessorNode::trace(Visitor* visitor) | 276 void ScriptProcessorNode::trace(Visitor* visitor) |
278 { | 277 { |
279 visitor->trace(m_inputBuffers); | 278 visitor->trace(m_inputBuffers); |
280 visitor->trace(m_outputBuffers); | 279 visitor->trace(m_outputBuffers); |
281 AudioNode::trace(visitor); | 280 AudioNode::trace(visitor); |
282 } | 281 } |
283 | 282 |
284 } // namespace blink | 283 } // namespace blink |
285 | 284 |
286 #endif // ENABLE(WEB_AUDIO) | 285 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |