| 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 11 matching lines...) Expand all Loading... |
| 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 22 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #include "modules/webaudio/ChannelSplitterNode.h" | 25 #include "modules/webaudio/ChannelSplitterNode.h" |
| 26 #include "bindings/core/v8/ExceptionMessages.h" | 26 #include "bindings/core/v8/ExceptionMessages.h" |
| 27 #include "bindings/core/v8/ExceptionState.h" | 27 #include "bindings/core/v8/ExceptionState.h" |
| 28 #include "core/dom/ExceptionCode.h" | 28 #include "core/dom/ExceptionCode.h" |
| 29 #include "modules/webaudio/AudioNodeInput.h" | 29 #include "modules/webaudio/AudioNodeInput.h" |
| 30 #include "modules/webaudio/AudioNodeOutput.h" | 30 #include "modules/webaudio/AudioNodeOutput.h" |
| 31 #include "modules/webaudio/BaseAudioContext.h" | 31 #include "modules/webaudio/BaseAudioContext.h" |
| 32 #include "modules/webaudio/ChannelSplitterOptions.h" |
| 32 | 33 |
| 33 namespace blink { | 34 namespace blink { |
| 34 | 35 |
| 35 ChannelSplitterHandler::ChannelSplitterHandler(AudioNode& node, float sampleRate
, unsigned numberOfOutputs) | 36 ChannelSplitterHandler::ChannelSplitterHandler(AudioNode& node, float sampleRate
, unsigned numberOfOutputs) |
| 36 : AudioHandler(NodeTypeChannelSplitter, node, sampleRate) | 37 : AudioHandler(NodeTypeChannelSplitter, node, sampleRate) |
| 37 { | 38 { |
| 38 addInput(); | 39 addInput(); |
| 39 | 40 |
| 40 // Create a fixed number of outputs (able to handle the maximum number of ch
annels fed to an input). | 41 // Create a fixed number of outputs (able to handle the maximum number of ch
annels fed to an input). |
| 41 for (unsigned i = 0; i < numberOfOutputs; ++i) | 42 for (unsigned i = 0; i < numberOfOutputs; ++i) |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 1, | 107 1, |
| 107 ExceptionMessages::InclusiveBound, | 108 ExceptionMessages::InclusiveBound, |
| 108 BaseAudioContext::maxNumberOfChannels(), | 109 BaseAudioContext::maxNumberOfChannels(), |
| 109 ExceptionMessages::InclusiveBound)); | 110 ExceptionMessages::InclusiveBound)); |
| 110 return nullptr; | 111 return nullptr; |
| 111 } | 112 } |
| 112 | 113 |
| 113 return new ChannelSplitterNode(context, numberOfOutputs); | 114 return new ChannelSplitterNode(context, numberOfOutputs); |
| 114 } | 115 } |
| 115 | 116 |
| 117 ChannelSplitterNode* ChannelSplitterNode::create(BaseAudioContext* context, cons
t ChannelSplitterOptions& options, ExceptionState& exceptionState) |
| 118 { |
| 119 ChannelSplitterNode* node; |
| 120 |
| 121 node = create(*context, options.numberOfOutputs(), exceptionState); |
| 122 |
| 123 if (!node) |
| 124 return node; |
| 125 |
| 126 node->handleChannelOptions(options, exceptionState); |
| 127 |
| 128 return node; |
| 129 } |
| 130 |
| 116 } // namespace blink | 131 } // namespace blink |
| 117 | 132 |
| OLD | NEW |