diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/Modules/webaudio/AudioNodeInput.cpp | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/Modules/webaudio/AudioNodeInput.cpp')
-rw-r--r-- | Source/WebCore/Modules/webaudio/AudioNodeInput.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/Source/WebCore/Modules/webaudio/AudioNodeInput.cpp b/Source/WebCore/Modules/webaudio/AudioNodeInput.cpp index c62333d2b..ccaa51d82 100644 --- a/Source/WebCore/Modules/webaudio/AudioNodeInput.cpp +++ b/Source/WebCore/Modules/webaudio/AudioNodeInput.cpp @@ -45,7 +45,7 @@ AudioNodeInput::AudioNodeInput(AudioNode* node) void AudioNodeInput::connect(AudioNodeOutput* output) { - ASSERT(context()->isGraphOwner()); + ASSERT(context().isGraphOwner()); ASSERT(output && node()); if (!output || !node()) @@ -64,7 +64,7 @@ void AudioNodeInput::connect(AudioNodeOutput* output) void AudioNodeInput::disconnect(AudioNodeOutput* output) { - ASSERT(context()->isGraphOwner()); + ASSERT(context().isGraphOwner()); ASSERT(output && node()); if (!output || !node()) @@ -90,7 +90,7 @@ void AudioNodeInput::disconnect(AudioNodeOutput* output) void AudioNodeInput::disable(AudioNodeOutput* output) { - ASSERT(context()->isGraphOwner()); + ASSERT(context().isGraphOwner()); ASSERT(output && node()); if (!output || !node()) @@ -108,7 +108,7 @@ void AudioNodeInput::disable(AudioNodeOutput* output) void AudioNodeInput::enable(AudioNodeOutput* output) { - ASSERT(context()->isGraphOwner()); + ASSERT(context().isGraphOwner()); ASSERT(output && node()); if (!output || !node()) @@ -132,7 +132,7 @@ void AudioNodeInput::didUpdate() void AudioNodeInput::updateInternalBus() { - ASSERT(context()->isAudioThread() && context()->isGraphOwner()); + ASSERT(context().isAudioThread() && context().isGraphOwner()); unsigned numberOfInputChannels = numberOfChannels(); @@ -151,8 +151,7 @@ unsigned AudioNodeInput::numberOfChannels() const // Find the number of channels of the connection with the largest number of channels. unsigned maxChannels = 1; // one channel is the minimum allowed - for (HashSet<AudioNodeOutput*>::iterator i = m_outputs.begin(); i != m_outputs.end(); ++i) { - AudioNodeOutput* output = *i; + for (auto& output : m_outputs) { // Use output()->numberOfChannels() instead of output->bus()->numberOfChannels(), // because the calling of AudioNodeOutput::bus() is not safe here. maxChannels = std::max(maxChannels, output->numberOfChannels()); @@ -166,7 +165,7 @@ unsigned AudioNodeInput::numberOfChannels() const AudioBus* AudioNodeInput::bus() { - ASSERT(context()->isAudioThread()); + ASSERT(context().isAudioThread()); // Handle single connection specially to allow for in-place processing. if (numberOfRenderingConnections() == 1 && node()->internalChannelCountMode() == AudioNode::Max) @@ -178,14 +177,14 @@ AudioBus* AudioNodeInput::bus() AudioBus* AudioNodeInput::internalSummingBus() { - ASSERT(context()->isAudioThread()); + ASSERT(context().isAudioThread()); return m_internalSummingBus.get(); } void AudioNodeInput::sumAllConnections(AudioBus* summingBus, size_t framesToProcess) { - ASSERT(context()->isAudioThread()); + ASSERT(context().isAudioThread()); // We shouldn't be calling this method if there's only one connection, since it's less efficient. ASSERT(numberOfRenderingConnections() > 1 || node()->internalChannelCountMode() != AudioNode::Max); @@ -198,8 +197,7 @@ void AudioNodeInput::sumAllConnections(AudioBus* summingBus, size_t framesToProc AudioBus::ChannelInterpretation interpretation = node()->internalChannelInterpretation(); - for (unsigned i = 0; i < numberOfRenderingConnections(); ++i) { - AudioNodeOutput* output = renderingOutput(i); + for (auto& output : m_renderingOutputs) { ASSERT(output); // Render audio from this output. @@ -212,7 +210,7 @@ void AudioNodeInput::sumAllConnections(AudioBus* summingBus, size_t framesToProc AudioBus* AudioNodeInput::pull(AudioBus* inPlaceBus, size_t framesToProcess) { - ASSERT(context()->isAudioThread()); + ASSERT(context().isAudioThread()); // Handle single connection case. if (numberOfRenderingConnections() == 1 && node()->internalChannelCountMode() == AudioNode::Max) { |