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 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 16 matching lines...) Expand all Loading... |
27 */ | 27 */ |
28 | 28 |
29 #include "modules/webaudio/ChannelMergerNode.h" | 29 #include "modules/webaudio/ChannelMergerNode.h" |
30 #include "bindings/core/v8/ExceptionMessages.h" | 30 #include "bindings/core/v8/ExceptionMessages.h" |
31 #include "bindings/core/v8/ExceptionState.h" | 31 #include "bindings/core/v8/ExceptionState.h" |
32 #include "core/dom/ExceptionCode.h" | 32 #include "core/dom/ExceptionCode.h" |
33 #include "core/dom/ExecutionContext.h" | 33 #include "core/dom/ExecutionContext.h" |
34 #include "modules/webaudio/AudioNodeInput.h" | 34 #include "modules/webaudio/AudioNodeInput.h" |
35 #include "modules/webaudio/AudioNodeOutput.h" | 35 #include "modules/webaudio/AudioNodeOutput.h" |
36 #include "modules/webaudio/BaseAudioContext.h" | 36 #include "modules/webaudio/BaseAudioContext.h" |
| 37 #include "modules/webaudio/ChannelMergerOptions.h" |
37 | 38 |
38 | 39 |
39 namespace blink { | 40 namespace blink { |
40 | 41 |
41 ChannelMergerHandler::ChannelMergerHandler(AudioNode& node, float sampleRate, un
signed numberOfInputs) | 42 ChannelMergerHandler::ChannelMergerHandler(AudioNode& node, float sampleRate, un
signed numberOfInputs) |
42 : AudioHandler(NodeTypeChannelMerger, node, sampleRate) | 43 : AudioHandler(NodeTypeChannelMerger, node, sampleRate) |
43 { | 44 { |
44 // These properties are fixed for the node and cannot be changed by user. | 45 // These properties are fixed for the node and cannot be changed by user. |
45 m_channelCount = 1; | 46 m_channelCount = 1; |
46 setInternalChannelCountMode(Explicit); | 47 setInternalChannelCountMode(Explicit); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 1, | 152 1, |
152 ExceptionMessages::InclusiveBound, | 153 ExceptionMessages::InclusiveBound, |
153 BaseAudioContext::maxNumberOfChannels(), | 154 BaseAudioContext::maxNumberOfChannels(), |
154 ExceptionMessages::InclusiveBound)); | 155 ExceptionMessages::InclusiveBound)); |
155 return nullptr; | 156 return nullptr; |
156 } | 157 } |
157 | 158 |
158 return new ChannelMergerNode(context, numberOfInputs); | 159 return new ChannelMergerNode(context, numberOfInputs); |
159 } | 160 } |
160 | 161 |
| 162 ChannelMergerNode* ChannelMergerNode::create(BaseAudioContext* context, const Ch
annelMergerOptions& options, ExceptionState& exceptionState) |
| 163 { |
| 164 ChannelMergerNode* node = create(*context, options.numberOfInputs(), excepti
onState); |
| 165 |
| 166 if (!node) |
| 167 return nullptr; |
| 168 |
| 169 node->handleChannelOptions(options, exceptionState); |
| 170 |
| 171 return node; |
| 172 } |
| 173 |
161 } // namespace blink | 174 } // namespace blink |
162 | 175 |
OLD | NEW |