Index: third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp |
diff --git a/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp b/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp |
index 417a55ec582f53f9c2b114332188f61c23ece06e..8aa47a01c5f5da0114e152d6a298f86d168163b0 100644 |
--- a/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp |
+++ b/third_party/WebKit/Source/modules/webaudio/DynamicsCompressorNode.cpp |
@@ -25,6 +25,7 @@ |
#include "modules/webaudio/AudioNodeInput.h" |
#include "modules/webaudio/AudioNodeOutput.h" |
#include "modules/webaudio/DynamicsCompressorNode.h" |
+#include "modules/webaudio/DynamicsCompressorOptions.h" |
#include "platform/audio/DynamicsCompressor.h" |
#include "wtf/PtrUtil.h" |
@@ -156,6 +157,29 @@ DynamicsCompressorNode* DynamicsCompressorNode::create(BaseAudioContext& context |
return new DynamicsCompressorNode(context); |
} |
+DynamicsCompressorNode* DynamicsCompressorNode::create(BaseAudioContext* context, const DynamicsCompressorOptions& options, ExceptionState& exceptionState) |
+{ |
+ DynamicsCompressorNode* node = create(*context, exceptionState); |
+ |
+ if (!node) |
+ return node; |
hongchan
2016/09/12 18:56:32
return nullptr;
|
+ |
+ node->handleChannelOptions(options, exceptionState); |
+ |
+ if (options.hasAttack()) |
+ node->attack()->setValue(options.attack()); |
+ if (options.hasKnee()) |
+ node->knee()->setValue(options.knee()); |
+ if (options.hasRatio()) |
+ node->ratio()->setValue(options.ratio()); |
+ if (options.hasRelease()) |
+ node->release()->setValue(options.release()); |
+ if (options.hasThreshold()) |
+ node->threshold()->setValue(options.threshold()); |
+ |
+ return node; |
+} |
+ |
DEFINE_TRACE(DynamicsCompressorNode) |
{ |
visitor->trace(m_threshold); |