| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 void AudioNodeOutput::addInput(AudioNodeInput* input) | 154 void AudioNodeOutput::addInput(AudioNodeInput* input) |
| 155 { | 155 { |
| 156 ASSERT(context()->isGraphOwner()); | 156 ASSERT(context()->isGraphOwner()); |
| 157 | 157 |
| 158 ASSERT(input); | 158 ASSERT(input); |
| 159 if (!input) | 159 if (!input) |
| 160 return; | 160 return; |
| 161 | 161 |
| 162 m_inputs.add(input); | 162 m_inputs.add(input); |
| 163 m_inputNodes.add(input->node()); |
| 164 input->node()->makeConnection(); |
| 163 } | 165 } |
| 164 | 166 |
| 165 void AudioNodeOutput::removeInput(AudioNodeInput* input) | 167 void AudioNodeOutput::removeInput(AudioNodeInput* input) |
| 166 { | 168 { |
| 167 ASSERT(context()->isGraphOwner()); | 169 ASSERT(context()->isGraphOwner()); |
| 168 | 170 |
| 169 ASSERT(input); | 171 ASSERT(input); |
| 170 if (!input) | 172 if (!input) |
| 171 return; | 173 return; |
| 172 | 174 |
| 173 m_inputs.remove(input); | 175 m_inputs.remove(input); |
| 176 input->node()->breakConnection(); |
| 177 m_inputNodes.remove(input->node()); |
| 174 } | 178 } |
| 175 | 179 |
| 176 void AudioNodeOutput::disconnectAllInputs() | 180 void AudioNodeOutput::disconnectAllInputs() |
| 177 { | 181 { |
| 178 ASSERT(context()->isGraphOwner()); | 182 ASSERT(context()->isGraphOwner()); |
| 179 | 183 |
| 180 // AudioNodeInput::disconnect() changes m_inputs by calling removeInput(). | 184 // AudioNodeInput::disconnect() changes m_inputs by calling removeInput(). |
| 181 while (!m_inputs.isEmpty()) { | 185 while (!m_inputs.isEmpty()) { |
| 182 AudioNodeInput* input = *m_inputs.begin(); | 186 AudioNodeInput* input = *m_inputs.begin(); |
| 183 input->disconnect(this); | 187 input->disconnect(this); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 AudioNodeInput* input = *i; | 249 AudioNodeInput* input = *i; |
| 246 input->enable(this); | 250 input->enable(this); |
| 247 } | 251 } |
| 248 m_isEnabled = true; | 252 m_isEnabled = true; |
| 249 } | 253 } |
| 250 } | 254 } |
| 251 | 255 |
| 252 } // namespace WebCore | 256 } // namespace WebCore |
| 253 | 257 |
| 254 #endif // ENABLE(WEB_AUDIO) | 258 #endif // ENABLE(WEB_AUDIO) |
| OLD | NEW |