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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 if (!numberOfInputChannels && !numberOfOutputChannels) | 79 if (!numberOfInputChannels && !numberOfOutputChannels) |
80 return 0; | 80 return 0; |
81 | 81 |
82 if (numberOfInputChannels > AudioContext::maxNumberOfChannels()) | 82 if (numberOfInputChannels > AudioContext::maxNumberOfChannels()) |
83 return 0; | 83 return 0; |
84 | 84 |
85 if (numberOfOutputChannels > AudioContext::maxNumberOfChannels()) | 85 if (numberOfOutputChannels > AudioContext::maxNumberOfChannels()) |
86 return 0; | 86 return 0; |
87 | 87 |
88 return adoptRefCountedGarbageCollectedWillBeNoop(new ScriptProcessorNode(con
text, sampleRate, bufferSize, numberOfInputChannels, numberOfOutputChannels)); | 88 return new ScriptProcessorNode(context, sampleRate, bufferSize, numberOfInpu
tChannels, numberOfOutputChannels); |
89 } | 89 } |
90 | 90 |
91 ScriptProcessorNode::ScriptProcessorNode(AudioContext* context, float sampleRate
, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChan
nels) | 91 ScriptProcessorNode::ScriptProcessorNode(AudioContext* context, float sampleRate
, size_t bufferSize, unsigned numberOfInputChannels, unsigned numberOfOutputChan
nels) |
92 : AudioNode(context, sampleRate) | 92 : AudioNode(context, sampleRate) |
93 , m_doubleBufferIndex(0) | 93 , m_doubleBufferIndex(0) |
94 , m_doubleBufferIndexForEvent(0) | 94 , m_doubleBufferIndexForEvent(0) |
95 , m_bufferSize(bufferSize) | 95 , m_bufferSize(bufferSize) |
96 , m_bufferReadWriteIndex(0) | 96 , m_bufferReadWriteIndex(0) |
97 , m_numberOfInputChannels(numberOfInputChannels) | 97 , m_numberOfInputChannels(numberOfInputChannels) |
98 , m_numberOfOutputChannels(numberOfOutputChannels) | 98 , m_numberOfOutputChannels(numberOfOutputChannels) |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 void ScriptProcessorNode::trace(Visitor* visitor) | 303 void ScriptProcessorNode::trace(Visitor* visitor) |
304 { | 304 { |
305 visitor->trace(m_inputBuffers); | 305 visitor->trace(m_inputBuffers); |
306 visitor->trace(m_outputBuffers); | 306 visitor->trace(m_outputBuffers); |
307 AudioNode::trace(visitor); | 307 AudioNode::trace(visitor); |
308 } | 308 } |
309 | 309 |
310 } // namespace blink | 310 } // namespace blink |
311 | 311 |
312 #endif // ENABLE(WEB_AUDIO) | 312 #endif // ENABLE(WEB_AUDIO) |
OLD | NEW |