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

Unified Diff: third_party/WebKit/Source/modules/webaudio/DelayNode.cpp

Issue 2102133002: Add constructors for WebAudio nodes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and prefix use counter names with WebAudio Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/webaudio/DelayNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp b/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp
index 5e9a1414926b3d4ac3197607b31e7d1e82a15299..a99908cc86a43c89f4381ad5dd5e221e02d95011 100644
--- a/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/DelayNode.cpp
@@ -27,6 +27,7 @@
#include "core/dom/ExceptionCode.h"
#include "modules/webaudio/AudioBasicProcessorHandler.h"
#include "modules/webaudio/DelayNode.h"
+#include "modules/webaudio/DelayOptions.h"
#include "modules/webaudio/DelayProcessor.h"
#include "wtf/MathExtras.h"
#include "wtf/PtrUtil.h"
@@ -83,6 +84,22 @@ DelayNode* DelayNode::create(BaseAudioContext& context, double maxDelayTime, Exc
return new DelayNode(context, maxDelayTime);
}
+DelayNode* DelayNode::create(BaseAudioContext* context, const DelayOptions& options, ExceptionState& exceptionState)
+{
+ // maxDelayTime has a default value specified.
+ DelayNode* node = create(*context, options.maxDelayTime(), exceptionState);
+
+ if (!node)
+ return nullptr;
+
+ node->handleChannelOptions(options, exceptionState);
+
+ if (options.hasDelayTime())
+ node->delayTime()->setValue(options.delayTime());
+
+ return node;
+}
+
AudioParam* DelayNode::delayTime()
{
return m_delayTime;
« no previous file with comments | « third_party/WebKit/Source/modules/webaudio/DelayNode.h ('k') | third_party/WebKit/Source/modules/webaudio/DelayNode.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698