Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: Source/modules/webaudio/AudioNode.cpp

Issue 645853010: Make reduction value of dynamics compressor zero when no sources are connected (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git/+/master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/modules/webaudio/AudioNode.h ('k') | Source/modules/webaudio/DynamicsCompressorNode.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 void AudioNode::initialize() 82 void AudioNode::initialize()
83 { 83 {
84 m_isInitialized = true; 84 m_isInitialized = true;
85 } 85 }
86 86
87 void AudioNode::uninitialize() 87 void AudioNode::uninitialize()
88 { 88 {
89 m_isInitialized = false; 89 m_isInitialized = false;
90 } 90 }
91 91
92 void AudioNode::clearInternalStateWhenDisabled()
93 {
94 }
95
92 void AudioNode::dispose() 96 void AudioNode::dispose()
93 { 97 {
94 ASSERT(isMainThread()); 98 ASSERT(isMainThread());
95 ASSERT(context()->isGraphOwner()); 99 ASSERT(context()->isGraphOwner());
96 100
97 context()->removeChangedChannelCountMode(this); 101 context()->removeChangedChannelCountMode(this);
98 context()->removeAutomaticPullNode(this); 102 context()->removeAutomaticPullNode(this);
99 context()->disposeOutputs(*this); 103 context()->disposeOutputs(*this);
100 for (unsigned i = 0; i < m_outputs.size(); ++i) 104 for (unsigned i = 0; i < m_outputs.size(); ++i)
101 output(i)->disconnectAll(); 105 output(i)->disconnectAll();
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 // As far as JavaScript is concerned, our outputs must still appear to b e connected. 472 // As far as JavaScript is concerned, our outputs must still appear to b e connected.
469 // But internally our outputs should be disabled from the inputs they're connected to. 473 // But internally our outputs should be disabled from the inputs they're connected to.
470 // disable() can recursively deref connections (and call disable()) down a whole chain of connected nodes. 474 // disable() can recursively deref connections (and call disable()) down a whole chain of connected nodes.
471 475
472 // FIXME: we special case the convolver and delay since they have a sign ificant tail-time and shouldn't be disconnected simply 476 // FIXME: we special case the convolver and delay since they have a sign ificant tail-time and shouldn't be disconnected simply
473 // because they no longer have any input connections. This needs to be h andled more generally where AudioNodes have 477 // because they no longer have any input connections. This needs to be h andled more generally where AudioNodes have
474 // a tailTime attribute. Then the AudioNode only needs to remain "active " for tailTime seconds after there are no 478 // a tailTime attribute. Then the AudioNode only needs to remain "active " for tailTime seconds after there are no
475 // longer any active connections. 479 // longer any active connections.
476 if (nodeType() != NodeTypeConvolver && nodeType() != NodeTypeDelay) { 480 if (nodeType() != NodeTypeConvolver && nodeType() != NodeTypeDelay) {
477 m_isDisabled = true; 481 m_isDisabled = true;
482 clearInternalStateWhenDisabled();
478 for (unsigned i = 0; i < m_outputs.size(); ++i) 483 for (unsigned i = 0; i < m_outputs.size(); ++i)
479 output(i)->disable(); 484 output(i)->disable();
480 } 485 }
481 } 486 }
482 } 487 }
483 488
484 void AudioNode::makeConnection() 489 void AudioNode::makeConnection()
485 { 490 {
486 atomicIncrement(&m_connectionRefCount); 491 atomicIncrement(&m_connectionRefCount);
487 492
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 568
564 void AudioNode::updateChannelCountMode() 569 void AudioNode::updateChannelCountMode()
565 { 570 {
566 m_channelCountMode = m_newChannelCountMode; 571 m_channelCountMode = m_newChannelCountMode;
567 updateChannelsForInputs(); 572 updateChannelsForInputs();
568 } 573 }
569 574
570 } // namespace blink 575 } // namespace blink
571 576
572 #endif // ENABLE(WEB_AUDIO) 577 #endif // ENABLE(WEB_AUDIO)
OLDNEW
« no previous file with comments | « Source/modules/webaudio/AudioNode.h ('k') | Source/modules/webaudio/DynamicsCompressorNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698