| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // This will propagate the channel count to any nodes connected further
downstream in the graph. | 112 // This will propagate the channel count to any nodes connected further
downstream in the graph. |
| 113 output(0).setNumberOfChannels(numberOfChannels); | 113 output(0).setNumberOfChannels(numberOfChannels); |
| 114 initialize(); | 114 initialize(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 AudioHandler::checkNumberOfChannelsForInput(input); | 117 AudioHandler::checkNumberOfChannelsForInput(input); |
| 118 } | 118 } |
| 119 | 119 |
| 120 // ---------------------------------------------------------------- | 120 // ---------------------------------------------------------------- |
| 121 | 121 |
| 122 GainNode::GainNode(AbstractAudioContext& context) | 122 GainNode::GainNode(BaseAudioContext& context) |
| 123 : AudioNode(context) | 123 : AudioNode(context) |
| 124 , m_gain(AudioParam::create(context, ParamTypeGainGain, 1.0)) | 124 , m_gain(AudioParam::create(context, ParamTypeGainGain, 1.0)) |
| 125 { | 125 { |
| 126 setHandler(GainHandler::create(*this, context.sampleRate(), m_gain->handler(
))); | 126 setHandler(GainHandler::create(*this, context.sampleRate(), m_gain->handler(
))); |
| 127 } | 127 } |
| 128 | 128 |
| 129 GainNode* GainNode::create(AbstractAudioContext& context, ExceptionState& except
ionState) | 129 GainNode* GainNode::create(BaseAudioContext& context, ExceptionState& exceptionS
tate) |
| 130 { | 130 { |
| 131 DCHECK(isMainThread()); | 131 DCHECK(isMainThread()); |
| 132 | 132 |
| 133 if (context.isContextClosed()) { | 133 if (context.isContextClosed()) { |
| 134 context.throwExceptionForClosedState(exceptionState); | 134 context.throwExceptionForClosedState(exceptionState); |
| 135 return nullptr; | 135 return nullptr; |
| 136 } | 136 } |
| 137 | 137 |
| 138 return new GainNode(context); | 138 return new GainNode(context); |
| 139 } | 139 } |
| 140 | 140 |
| 141 AudioParam* GainNode::gain() const | 141 AudioParam* GainNode::gain() const |
| 142 { | 142 { |
| 143 return m_gain; | 143 return m_gain; |
| 144 } | 144 } |
| 145 | 145 |
| 146 DEFINE_TRACE(GainNode) | 146 DEFINE_TRACE(GainNode) |
| 147 { | 147 { |
| 148 visitor->trace(m_gain); | 148 visitor->trace(m_gain); |
| 149 AudioNode::trace(visitor); | 149 AudioNode::trace(visitor); |
| 150 } | 150 } |
| 151 | 151 |
| 152 } // namespace blink | 152 } // namespace blink |
| 153 | 153 |
| OLD | NEW |