| 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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 | 703 |
| 704 bool AudioNode::disconnectFromOutputIfConnected( | 704 bool AudioNode::disconnectFromOutputIfConnected( |
| 705 unsigned outputIndex, | 705 unsigned outputIndex, |
| 706 AudioNode& destination, | 706 AudioNode& destination, |
| 707 unsigned inputIndexOfDestination) { | 707 unsigned inputIndexOfDestination) { |
| 708 AudioNodeOutput& output = handler().output(outputIndex); | 708 AudioNodeOutput& output = handler().output(outputIndex); |
| 709 AudioNodeInput& input = destination.handler().input(inputIndexOfDestination); | 709 AudioNodeInput& input = destination.handler().input(inputIndexOfDestination); |
| 710 if (!output.isConnectedToInput(input)) | 710 if (!output.isConnectedToInput(input)) |
| 711 return false; | 711 return false; |
| 712 output.disconnectInput(input); | 712 output.disconnectInput(input); |
| 713 m_connectedNodes[outputIndex]->remove(&destination); | 713 m_connectedNodes[outputIndex]->erase(&destination); |
| 714 return true; | 714 return true; |
| 715 } | 715 } |
| 716 | 716 |
| 717 bool AudioNode::disconnectFromOutputIfConnected(unsigned outputIndex, | 717 bool AudioNode::disconnectFromOutputIfConnected(unsigned outputIndex, |
| 718 AudioParam& param) { | 718 AudioParam& param) { |
| 719 AudioNodeOutput& output = handler().output(outputIndex); | 719 AudioNodeOutput& output = handler().output(outputIndex); |
| 720 if (!output.isConnectedToAudioParam(param.handler())) | 720 if (!output.isConnectedToAudioParam(param.handler())) |
| 721 return false; | 721 return false; |
| 722 output.disconnectAudioParam(param.handler()); | 722 output.disconnectAudioParam(param.handler()); |
| 723 m_connectedParams[outputIndex]->remove(¶m); | 723 m_connectedParams[outputIndex]->erase(¶m); |
| 724 return true; | 724 return true; |
| 725 } | 725 } |
| 726 | 726 |
| 727 void AudioNode::disconnect() { | 727 void AudioNode::disconnect() { |
| 728 DCHECK(isMainThread()); | 728 DCHECK(isMainThread()); |
| 729 BaseAudioContext::AutoLocker locker(context()); | 729 BaseAudioContext::AutoLocker locker(context()); |
| 730 | 730 |
| 731 // Disconnect all outgoing connections. | 731 // Disconnect all outgoing connections. |
| 732 for (unsigned i = 0; i < numberOfOutputs(); ++i) | 732 for (unsigned i = 0; i < numberOfOutputs(); ++i) |
| 733 disconnectAllFromOutput(i); | 733 disconnectAllFromOutput(i); |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 } | 952 } |
| 953 | 953 |
| 954 void AudioNode::didAddOutput(unsigned numberOfOutputs) { | 954 void AudioNode::didAddOutput(unsigned numberOfOutputs) { |
| 955 m_connectedNodes.push_back(nullptr); | 955 m_connectedNodes.push_back(nullptr); |
| 956 DCHECK_EQ(numberOfOutputs, m_connectedNodes.size()); | 956 DCHECK_EQ(numberOfOutputs, m_connectedNodes.size()); |
| 957 m_connectedParams.push_back(nullptr); | 957 m_connectedParams.push_back(nullptr); |
| 958 DCHECK_EQ(numberOfOutputs, m_connectedParams.size()); | 958 DCHECK_EQ(numberOfOutputs, m_connectedParams.size()); |
| 959 } | 959 } |
| 960 | 960 |
| 961 } // namespace blink | 961 } // namespace blink |
| OLD | NEW |